(* Content-type: application/vnd.wolfram.mathematica *)

(*** Wolfram Notebook File ***)
(* http://www.wolfram.com/nb *)

(* CreatedBy='Mathematica 10.4' *)

(*CacheID: 234*)
(* Internal cache information:
NotebookFileLineBreakTest
NotebookFileLineBreakTest
NotebookDataPosition[       158,          7]
NotebookDataLength[    103996,       2755]
NotebookOptionsPosition[     95440,       2469]
NotebookOutlinePosition[     96171,       2496]
CellTagsIndexPosition[     96039,       2490]
WindowFrame->Normal*)

(* Beginning of Notebook Content *)
Notebook[{

Cell[CellGroupData[{
Cell["MongoDB Link Examples", "Title",
 CellChangeTimes->{{3.662457973465026*^9, 3.662457976663933*^9}}],

Cell["\<\
Use latest 10.4/11.0 builds. Also, this assumes you\[CloseCurlyQuote]ve built \
MongoLink.\
\>", "Item"],

Cell[BoxData[{
 RowBox[{
  RowBox[{"PacletDirectoryAdd", "[", 
   RowBox[{"ParentDirectory", "@", 
    RowBox[{"NotebookDirectory", "[", "]"}]}], "]"}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{"<<", "GeneralUtilities`"}], "\n", 
 RowBox[{"<<", "MongoLink`"}]}], "Code"],

Cell[TextData[{
 "For sandbox purposes, use the ARG Mongo Test server (anyone has read/write \
access, but no guarantees that any data you upload will not be \
deleted/overwritten ",
 StyleBox["at any point",
  FontSlant->"Italic"],
 ")."
}], "Item"],

Cell[CellGroupData[{

Cell[BoxData[{
 RowBox[{
  RowBox[{
  "$URI", " ", "=", " ", 
   "\"\<mongodb://arg:ARGTest@arg-ml-0.wolfram-arg.9431.mongodbdns.com:27000/\
Test\>\""}], ";"}], "\n", 
 RowBox[{
  RowBox[{"$client", " ", "=", " ", 
   RowBox[{"ClientConnect", "[", "$URI", "]"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{"$db", " ", "=", " ", 
  RowBox[{"DatabaseConnect", "[", 
   RowBox[{"$client", ",", " ", "\"\<Test\>\""}], "]"}]}]}], "Code"],

Cell[BoxData[
 RowBox[{"MongoDatabase", "[", "1", "]"}]], "Output",
 CellChangeTimes->{3.667943313705689*^9}]
}, Open  ]],

Cell[BoxData["Quit"], "Input"],

Cell[CellGroupData[{

Cell["Tutorial:", "Subchapter",
 CellChangeTimes->{{3.6627301212516003`*^9, 3.662730122026401*^9}, {
   3.662730326028225*^9, 3.662730331794251*^9}, 3.662791848691955*^9}],

Cell[CellGroupData[{

Cell["Collection-level ops", "Subsection"],

Cell["List all available collections:", "Item"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"datasets", "=", 
  RowBox[{"DatabaseCollectionNames", "@", "$db"}]}]], "Input"],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{"\<\"SebUniqueTestCollection\"\>", 
   ",", "\<\"SebUniqueTestCollection2\"\>", ",", "\<\"TestCollection\"\>", 
   ",", "\<\"WendyTestCollection\"\>"}], "}"}]], "Output",
 CellChangeTimes->{3.667943319450965*^9}]
}, Open  ]],

Cell["\<\
Create new collection which we will use with this tutorial, and delete after \
(choose something unique):\
\>", "Item"],

Cell[CellGroupData[{

Cell[BoxData[{
 RowBox[{
  RowBox[{"$UniqueName", "=", "\"\<SebUniqueTestCollection\>\""}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{"DatabaseCreateCollection", "[", 
  RowBox[{"$db", ",", "$UniqueName"}], "]"}], "\[IndentingNewLine]", 
 RowBox[{"$testCollection", "=", 
  RowBox[{"CollectionConnect", "[", 
   RowBox[{"$db", ",", "$UniqueName"}], "]"}]}]}], "Input"],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"DatabaseCreateCollection", "::", "mongoError"}], "MessageName"], 
  RowBox[{":", " "}], "\<\"collection already exists\"\>"}]], "Message", \
"MSG"],

Cell[BoxData["$Failed"], "Output"],

Cell[BoxData[
 RowBox[{"MongoCollection", "[", "2", "]"}]], "Output"]
}, Open  ]]
}, Open  ]],

Cell[CellGroupData[{

Cell["Inserting Documents", "Subsection"],

Cell["Consider two docs:", "Item"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"data", "=", 
  RowBox[{"Dataset", "[", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"<|", 
      RowBox[{
       RowBox[{"\"\<Type\>\"", "\[Rule]", " ", "\"\<Image\>\""}], ",", 
       RowBox[{"\"\<Dimensions\>\"", "\[Rule]", " ", 
        RowBox[{"{", 
         RowBox[{"288", ",", "299"}], "}"}]}], ",", " ", 
       RowBox[{"\"\<BoundingBoxes\>\"", "\[Rule]", " ", 
        RowBox[{"{", 
         RowBox[{
          RowBox[{"{", 
           RowBox[{"1", ",", "3.3", ",", "6.6", ",", "2.3"}], "}"}], ",", 
          RowBox[{"{", 
           RowBox[{"4.6", ",", "3.4", ",", "2.2", ",", "7."}], "}"}]}], 
         "}"}]}], ",", 
       RowBox[{"\"\<BoundingBoxLabels\>\"", "\[Rule]", " ", 
        RowBox[{"{", 
         RowBox[{"\"\<Dog\>\"", ",", "\"\<Lion\>\""}], "}"}]}], ",", 
       RowBox[{"\"\<ModifiedDate\>\"", "\[Rule]", " ", 
        RowBox[{"DateObject", "[", "]"}]}]}], "|>"}], ",", 
     RowBox[{"<|", 
      RowBox[{
       RowBox[{"\"\<Type\>\"", "\[Rule]", " ", "\"\<Image\>\""}], ",", 
       RowBox[{"\"\<Dimensions\>\"", "\[Rule]", " ", 
        RowBox[{"{", 
         RowBox[{"234", ",", "334"}], "}"}]}], ",", " ", 
       RowBox[{"\"\<BoundingBoxes\>\"", "\[Rule]", " ", 
        RowBox[{"{", 
         RowBox[{"{", 
          RowBox[{"0.3", ",", "6.7", ",", "6.6", ",", "2.3"}], "}"}], "}"}]}],
        ",", 
       RowBox[{"\"\<BoundingBoxLabels\>\"", "\[Rule]", " ", 
        RowBox[{"{", "\"\<Hyena\>\"", "}"}]}], ",", " ", 
       RowBox[{"\"\<ModifiedDate\>\"", "\[Rule]", " ", 
        RowBox[{"DateObject", "[", "]"}]}]}], "|>"}]}], "}"}], 
   "]"}]}]], "Input",
 CellChangeTimes->{{3.6628268700502243`*^9, 3.662827086042739*^9}, {
  3.662827264969755*^9, 3.6628273269699*^9}, {3.663840332437353*^9, 
  3.663840362492766*^9}}],

Cell[BoxData[
 TagBox[
  TemplateBox[{GridBox[{{
       StyleBox["\"Type\"", 
        GrayLevel[0.3]], 
       StyleBox["\"Dimensions\"", 
        GrayLevel[0.3]], 
       StyleBox["\"BoundingBoxes\"", 
        GrayLevel[0.3]], 
       StyleBox["\"BoundingBoxLabels\"", 
        GrayLevel[0.3]], 
       StyleBox["\"ModifiedDate\"", 
        GrayLevel[0.3]]}, {
       StyleBox["\"Image\"", FontColor -> GrayLevel[0.4]], 
       StyleBox[
        RowBox[{"{", "\[ThinSpace]", 288, ",", 299, "\[ThinSpace]", "}"}], 
        LineBreakWithin -> Automatic], 
       StyleBox[
        RowBox[{"{", "\[ThinSpace]", 
          RowBox[{"{", 
            StyleBox[
             SubscriptBox["\[CenterEllipsis]", "4"], 
             GrayLevel[0.5]], "}"}], ",", 
          RowBox[{"{", 
            StyleBox[
             SubscriptBox["\[CenterEllipsis]", "4"], 
             GrayLevel[0.5]], "}"}], "\[ThinSpace]", "}"}], LineBreakWithin -> 
        Automatic], 
       StyleBox[
        RowBox[{"{", "\[ThinSpace]", 
          StyleBox["\"Dog\"", FontColor -> GrayLevel[0.4]], ",", 
          StyleBox["\"Lion\"", FontColor -> GrayLevel[0.4]], "\[ThinSpace]", 
          "}"}], LineBreakWithin -> Automatic], 
       InterpretationBox[
        TagBox[
         TooltipBox[
          StyleBox[
          "\"1 Mar 2016 17:58:02\"", FontFamily -> "Arial", FontSize -> 11, 
           FontWeight -> Bold, FontColor -> RGBColor[{
              Rational[33, 74], 
              Rational[27, 74], 
              Rational[117, 370]}]], 
          StyleBox[
          "DateObject[{2016, 3, 1}, TimeObject[{17, 58, 2.361818}, TimeZone \
-> 2.], TimeZone -> 2.]", FontWeight -> Bold, ShowStringCharacters -> True]], 
         
         MouseAppearanceTag["Arrow"]], 
        DateObject[{2016, 3, 1}, 
         TimeObject[{17, 58, 2.361818}, TimeZone -> 2.], TimeZone -> 2.]]}, {
       StyleBox["\"Image\"", FontColor -> GrayLevel[0.4]], 
       StyleBox[
        RowBox[{"{", "\[ThinSpace]", 234, ",", 334, "\[ThinSpace]", "}"}], 
        LineBreakWithin -> Automatic], 
       StyleBox[
        RowBox[{"{", "\[ThinSpace]", 
          RowBox[{"{", 
            StyleBox[
             SubscriptBox["\[CenterEllipsis]", "4"], 
             GrayLevel[0.5]], "}"}], "\[ThinSpace]", "}"}], LineBreakWithin -> 
        Automatic], 
       StyleBox[
        RowBox[{"{", "\[ThinSpace]", 
          StyleBox["\"Hyena\"", FontColor -> GrayLevel[0.4]], "\[ThinSpace]", 
          "}"}], LineBreakWithin -> Automatic], 
       InterpretationBox[
        TagBox[
         TooltipBox[
          StyleBox[
          "\"1 Mar 2016 17:58:02\"", FontFamily -> "Arial", FontSize -> 11, 
           FontWeight -> Bold, FontColor -> RGBColor[{
              Rational[33, 74], 
              Rational[27, 74], 
              Rational[117, 370]}]], 
          StyleBox[
          "DateObject[{2016, 3, 1}, TimeObject[{17, 58, 2.361881}, TimeZone \
-> 2.], TimeZone -> 2.]", FontWeight -> Bold, ShowStringCharacters -> True]], 
         
         MouseAppearanceTag["Arrow"]], 
        DateObject[{2016, 3, 1}, 
         TimeObject[{17, 58, 2.361881}, TimeZone -> 2.], TimeZone -> 2.]]}, {
       ItemBox[
        RowBox[{
          TagBox[
           TooltipBox["4 levels", 
            InterpretationBox[
             TagBox[
              TagBox[
               StyleBox[
                TagBox[
                 TooltipBox[
                  SubscriptBox[
                   RowBox[{"{", 
                    RowBox[{
                    TagBox[
                    TooltipBox[
                    FrameBox[
                    RowBox[{"\[LeftAssociation]", 
                    RowBox[{
                    RowBox[{
                    StyleBox[
                    "Type", FontColor -> RGBColor[0.6, 0.4, 0.2], FontFamily -> 
                    "Verdana", FontWeight -> Normal], 
                    StyleBox[
                    "\[Rule]", FontColor -> GrayLevel[0.65], FontWeight -> 
                    "Thin"], 
                    TagBox[
                    TooltipBox[
                    FrameBox[
                    StyleBox["Str", FontColor -> RGBColor[0, 
                    Rational[2, 3], 0], FontFamily -> "Monaco"], FrameStyle -> 
                    Dynamic[
                    If[
                    CurrentValue["MouseOver"], 
                    GrayLevel[0.9], None]], BaselinePosition -> Baseline, 
                    FrameMargins -> {{0, 0}, {2, 2}}, ContentPadding -> 
                    False], 
                    Cell[
                    BoxData[
                    InterpretationBox[
                    StyleBox[
                    "TypeSystem`Atom[String]", ShowStringCharacters -> True, 
                    NumberMarks -> True], 
                    InputForm[
                    TypeSystem`Atom[String]], Editable -> True, AutoDelete -> 
                    True]], "Input", FontTracking -> "Plain"], TooltipDelay -> 
                    0.25], 
                    EventHandlerTag[{"MouseClicked" :> CellPrint[
                    Cell[
                    ToString[
                    TypeSystem`Atom[String], InputForm], "Input"]], Method -> 
                    "Preemptive", PassEventsDown -> True, PassEventsUp -> 
                    False}]]}], 
                    StyleBox[
                    ",", FontColor -> GrayLevel[0.65], FontWeight -> "Thin"], 
                    
                    RowBox[{
                    StyleBox[
                    "Dimensions", FontColor -> RGBColor[0.6, 0.4, 0.2], 
                    FontFamily -> "Verdana", FontWeight -> Normal], 
                    StyleBox[
                    "\[Rule]", FontColor -> GrayLevel[0.65], FontWeight -> 
                    "Thin"], 
                    TagBox[
                    TooltipBox[
                    FrameBox[
                    SubscriptBox[
                    RowBox[{"{", 
                    RowBox[{
                    TagBox[
                    TooltipBox[
                    FrameBox[
                    StyleBox["Int", FontColor -> RGBColor[0, 
                    Rational[2, 3], 0], FontFamily -> "Monaco"], FrameStyle -> 
                    Dynamic[
                    If[
                    CurrentValue["MouseOver"], 
                    GrayLevel[0.9], None]], BaselinePosition -> Baseline, 
                    FrameMargins -> {{0, 0}, {2, 2}}, ContentPadding -> 
                    False], 
                    Cell[
                    BoxData[
                    InterpretationBox[
                    StyleBox[
                    "TypeSystem`Atom[Integer]", ShowStringCharacters -> True, 
                    NumberMarks -> True], 
                    InputForm[
                    TypeSystem`Atom[Integer]], Editable -> True, AutoDelete -> 
                    True]], "Input", FontTracking -> "Plain"], TooltipDelay -> 
                    0.25], 
                    EventHandlerTag[{"MouseClicked" :> CellPrint[
                    Cell[
                    ToString[
                    TypeSystem`Atom[Integer], InputForm], "Input"]], Method -> 
                    "Preemptive", PassEventsDown -> True, PassEventsUp -> 
                    False}]]}], "}"}], 
                    StyleBox[
                    "2", FontFamily -> "Arial", FontWeight -> Normal]], 
                    FrameStyle -> Dynamic[
                    If[
                    CurrentValue["MouseOver"], 
                    GrayLevel[0.9], None]], BaselinePosition -> Baseline, 
                    FrameMargins -> {{0, 0}, {2, 2}}, ContentPadding -> 
                    False], 
                    Cell[
                    BoxData[
                    InterpretationBox[
                    StyleBox[
                    "TypeSystem`Vector[TypeSystem`Atom[Integer], 2]", 
                    ShowStringCharacters -> True, NumberMarks -> True], 
                    InputForm[
                    TypeSystem`Vector[
                    TypeSystem`Atom[Integer], 2]], Editable -> True, 
                    AutoDelete -> True]], "Input", FontTracking -> "Plain"], 
                    TooltipDelay -> 0.25], 
                    EventHandlerTag[{"MouseClicked" :> CellPrint[
                    Cell[
                    ToString[
                    TypeSystem`Vector[
                    TypeSystem`Atom[Integer], 2], InputForm], "Input"]], 
                    Method -> "Preemptive", PassEventsDown -> True, 
                    PassEventsUp -> False}]]}], 
                    StyleBox[
                    ",", FontColor -> GrayLevel[0.65], FontWeight -> "Thin"], 
                    
                    RowBox[{
                    StyleBox[
                    "BoundingBoxes", FontColor -> RGBColor[0.6, 0.4, 0.2], 
                    FontFamily -> "Verdana", FontWeight -> Normal], 
                    StyleBox[
                    "\[Rule]", FontColor -> GrayLevel[0.65], FontWeight -> 
                    "Thin"], 
                    TagBox[
                    TooltipBox[
                    FrameBox[
                    RowBox[{"{", 
                    RowBox[{
                    TagBox[
                    TooltipBox[
                    FrameBox[
                    SubscriptBox[
                    RowBox[{"{", 
                    RowBox[{
                    TagBox[
                    TooltipBox[
                    FrameBox[
                    StyleBox["Real", FontColor -> RGBColor[0, 
                    Rational[2, 3], 0], FontFamily -> "Monaco"], FrameStyle -> 
                    Dynamic[
                    If[
                    CurrentValue["MouseOver"], 
                    GrayLevel[0.9], None]], BaselinePosition -> Baseline, 
                    FrameMargins -> {{0, 0}, {2, 2}}, ContentPadding -> 
                    False], 
                    Cell[
                    BoxData[
                    InterpretationBox[
                    StyleBox[
                    "TypeSystem`Atom[Real]", ShowStringCharacters -> True, 
                    NumberMarks -> True], 
                    InputForm[
                    TypeSystem`Atom[Real]], Editable -> True, AutoDelete -> 
                    True]], "Input", FontTracking -> "Plain"], TooltipDelay -> 
                    0.25], 
                    EventHandlerTag[{"MouseClicked" :> CellPrint[
                    Cell[
                    ToString[
                    TypeSystem`Atom[Real], InputForm], "Input"]], Method -> 
                    "Preemptive", PassEventsDown -> True, PassEventsUp -> 
                    False}]]}], "}"}], 
                    StyleBox["4", FontFamily -> "Arial", FontWeight -> 
                    Normal]], FrameStyle -> Dynamic[
                    If[
                    CurrentValue["MouseOver"], 
                    GrayLevel[0.9], None]], BaselinePosition -> Baseline, 
                    FrameMargins -> {{0, 0}, {2, 2}}, ContentPadding -> 
                    False], 
                    Cell[
                    BoxData[
                    InterpretationBox[
                    StyleBox[
                    "TypeSystem`Vector[TypeSystem`Atom[Real], 4]", 
                    ShowStringCharacters -> True, NumberMarks -> True], 
                    InputForm[
                    TypeSystem`Vector[
                    TypeSystem`Atom[Real], 4]], Editable -> True, AutoDelete -> 
                    True]], "Input", FontTracking -> "Plain"], TooltipDelay -> 
                    0.25], 
                    EventHandlerTag[{"MouseClicked" :> CellPrint[
                    Cell[
                    ToString[
                    TypeSystem`Vector[
                    TypeSystem`Atom[Real], 4], InputForm], "Input"]], Method -> 
                    "Preemptive", PassEventsDown -> True, PassEventsUp -> 
                    False}]]}], "}"}], FrameStyle -> Dynamic[
                    If[
                    CurrentValue["MouseOver"], 
                    GrayLevel[0.9], None]], BaselinePosition -> Baseline, 
                    FrameMargins -> {{0, 0}, {2, 2}}, ContentPadding -> 
                    False], 
                    Cell[
                    BoxData[
                    InterpretationBox[
                    StyleBox[
                    "TypeSystem`Vector[TypeSystem`Vector[TypeSystem`Atom[Real]\
, 4], TypeSystem`AnyLength]", ShowStringCharacters -> True, NumberMarks -> 
                    True], 
                    InputForm[
                    TypeSystem`Vector[
                    TypeSystem`Vector[
                    TypeSystem`Atom[Real], 4], TypeSystem`AnyLength]], 
                    Editable -> True, AutoDelete -> True]], "Input", 
                    FontTracking -> "Plain"], TooltipDelay -> 0.25], 
                    EventHandlerTag[{"MouseClicked" :> CellPrint[
                    Cell[
                    ToString[
                    TypeSystem`Vector[
                    TypeSystem`Vector[
                    TypeSystem`Atom[Real], 4], TypeSystem`AnyLength], 
                    InputForm], "Input"]], Method -> "Preemptive", 
                    PassEventsDown -> True, PassEventsUp -> False}]]}], 
                    StyleBox[
                    ",", FontColor -> GrayLevel[0.65], FontWeight -> "Thin"], 
                    
                    RowBox[{
                    StyleBox[
                    "BoundingBoxLabels", FontColor -> RGBColor[0.6, 0.4, 0.2],
                     FontFamily -> "Verdana", FontWeight -> Normal], 
                    StyleBox[
                    "\[Rule]", FontColor -> GrayLevel[0.65], FontWeight -> 
                    "Thin"], 
                    TagBox[
                    TooltipBox[
                    FrameBox[
                    RowBox[{"{", 
                    RowBox[{
                    TagBox[
                    TooltipBox[
                    FrameBox[
                    StyleBox["Str", FontColor -> RGBColor[0, 
                    Rational[2, 3], 0], FontFamily -> "Monaco"], FrameStyle -> 
                    Dynamic[
                    If[
                    CurrentValue["MouseOver"], 
                    GrayLevel[0.9], None]], BaselinePosition -> Baseline, 
                    FrameMargins -> {{0, 0}, {2, 2}}, ContentPadding -> 
                    False], 
                    Cell[
                    BoxData[
                    InterpretationBox[
                    StyleBox[
                    "TypeSystem`Atom[String]", ShowStringCharacters -> True, 
                    NumberMarks -> True], 
                    InputForm[
                    TypeSystem`Atom[String]], Editable -> True, AutoDelete -> 
                    True]], "Input", FontTracking -> "Plain"], TooltipDelay -> 
                    0.25], 
                    EventHandlerTag[{"MouseClicked" :> CellPrint[
                    Cell[
                    ToString[
                    TypeSystem`Atom[String], InputForm], "Input"]], Method -> 
                    "Preemptive", PassEventsDown -> True, PassEventsUp -> 
                    False}]]}], "}"}], FrameStyle -> Dynamic[
                    If[
                    CurrentValue["MouseOver"], 
                    GrayLevel[0.9], None]], BaselinePosition -> Baseline, 
                    FrameMargins -> {{0, 0}, {2, 2}}, ContentPadding -> 
                    False], 
                    Cell[
                    BoxData[
                    InterpretationBox[
                    StyleBox[
                    "TypeSystem`Vector[TypeSystem`Atom[String], \
TypeSystem`AnyLength]", ShowStringCharacters -> True, NumberMarks -> True], 
                    InputForm[
                    TypeSystem`Vector[
                    TypeSystem`Atom[String], TypeSystem`AnyLength]], Editable -> 
                    True, AutoDelete -> True]], "Input", FontTracking -> 
                    "Plain"], TooltipDelay -> 0.25], 
                    EventHandlerTag[{"MouseClicked" :> CellPrint[
                    Cell[
                    ToString[
                    TypeSystem`Vector[
                    TypeSystem`Atom[String], TypeSystem`AnyLength], 
                    InputForm], "Input"]], Method -> "Preemptive", 
                    PassEventsDown -> True, PassEventsUp -> False}]]}], 
                    StyleBox[
                    ",", FontColor -> GrayLevel[0.65], FontWeight -> "Thin"], 
                    
                    RowBox[{
                    StyleBox[
                    "ModifiedDate", FontColor -> RGBColor[0.6, 0.4, 0.2], 
                    FontFamily -> "Verdana", FontWeight -> Normal], 
                    StyleBox[
                    "\[Rule]", FontColor -> GrayLevel[0.65], FontWeight -> 
                    "Thin"], 
                    TagBox[
                    TooltipBox[
                    FrameBox[
                    StyleBox["D", FontColor -> RGBColor[0, 
                    Rational[2, 3], 0], FontFamily -> "Monaco"], FrameStyle -> 
                    Dynamic[
                    If[
                    CurrentValue["MouseOver"], 
                    GrayLevel[0.9], None]], BaselinePosition -> Baseline, 
                    FrameMargins -> {{0, 0}, {2, 2}}, ContentPadding -> 
                    False], 
                    Cell[
                    BoxData[
                    InterpretationBox[
                    StyleBox[
                    "TypeSystem`Atom[DateObject]", ShowStringCharacters -> 
                    True, NumberMarks -> True], 
                    InputForm[
                    TypeSystem`Atom[DateObject]], Editable -> True, 
                    AutoDelete -> True]], "Input", FontTracking -> "Plain"], 
                    TooltipDelay -> 0.25], 
                    EventHandlerTag[{"MouseClicked" :> CellPrint[
                    Cell[
                    ToString[
                    TypeSystem`Atom[DateObject], InputForm], "Input"]], 
                    Method -> "Preemptive", PassEventsDown -> True, 
                    PassEventsUp -> False}]]}]}], "\[RightAssociation]"}], 
                    FrameStyle -> Dynamic[
                    If[
                    CurrentValue["MouseOver"], 
                    GrayLevel[0.9], None]], BaselinePosition -> Baseline, 
                    FrameMargins -> {{0, 0}, {2, 2}}, ContentPadding -> 
                    False], 
                    Cell[
                    BoxData[
                    InterpretationBox[
                    StyleBox[
                    "TypeSystem`Struct[{\"Type\", \"Dimensions\", \
\"BoundingBoxes\", \"BoundingBoxLabels\", \"ModifiedDate\"}, \
{TypeSystem`Atom[String], TypeSystem`Vector[TypeSystem`Atom[Integer], 2], \
TypeSystem`Vector[TypeSystem`Vector[TypeSystem`Atom[Real], 4], \
TypeSystem`AnyLength], TypeSystem`Vector[TypeSystem`Atom[String], \
TypeSystem`AnyLength], TypeSystem`Atom[DateObject]}]", ShowStringCharacters -> 
                    True, NumberMarks -> True], 
                    InputForm[
                    
                    TypeSystem`Struct[{
                    "Type", "Dimensions", "BoundingBoxes", 
                    "BoundingBoxLabels", "ModifiedDate"}, {
                    TypeSystem`Atom[String], 
                    TypeSystem`Vector[
                    TypeSystem`Atom[Integer], 2], 
                    TypeSystem`Vector[
                    TypeSystem`Vector[
                    TypeSystem`Atom[Real], 4], TypeSystem`AnyLength], 
                    TypeSystem`Vector[
                    TypeSystem`Atom[String], TypeSystem`AnyLength], 
                    TypeSystem`Atom[DateObject]}]], Editable -> True, 
                    AutoDelete -> True]], "Input", FontTracking -> "Plain"], 
                    TooltipDelay -> 0.25], 
                    EventHandlerTag[{"MouseClicked" :> CellPrint[
                    Cell[
                    ToString[
                    
                    TypeSystem`Struct[{
                    "Type", "Dimensions", "BoundingBoxes", 
                    "BoundingBoxLabels", "ModifiedDate"}, {
                    TypeSystem`Atom[String], 
                    TypeSystem`Vector[
                    TypeSystem`Atom[Integer], 2], 
                    TypeSystem`Vector[
                    TypeSystem`Vector[
                    TypeSystem`Atom[Real], 4], TypeSystem`AnyLength], 
                    TypeSystem`Vector[
                    TypeSystem`Atom[String], TypeSystem`AnyLength], 
                    TypeSystem`Atom[DateObject]}], InputForm], "Input"]], 
                    Method -> "Preemptive", PassEventsDown -> True, 
                    PassEventsUp -> False}]]}], "}"}], 
                   StyleBox[
                   "2", FontFamily -> "Arial", FontWeight -> Normal]], 
                  Cell[
                   BoxData[
                    InterpretationBox[
                    StyleBox[
                    "TypeSystem`Vector[TypeSystem`Struct[{\"Type\", \
\"Dimensions\", \"BoundingBoxes\", \"BoundingBoxLabels\", \"ModifiedDate\"}, \
{TypeSystem`Atom[String], TypeSystem`Vector[TypeSystem`Atom[Integer], 2], \
TypeSystem`Vector[TypeSystem`Vector[TypeSystem`Atom[Real], 4], \
TypeSystem`AnyLength], TypeSystem`Vector[TypeSystem`Atom[String], \
TypeSystem`AnyLength], TypeSystem`Atom[DateObject]}], 2]", 
                    ShowStringCharacters -> True, NumberMarks -> True], 
                    InputForm[
                    TypeSystem`Vector[
                    
                    TypeSystem`Struct[{
                    "Type", "Dimensions", "BoundingBoxes", 
                    "BoundingBoxLabels", "ModifiedDate"}, {
                    TypeSystem`Atom[String], 
                    TypeSystem`Vector[
                    TypeSystem`Atom[Integer], 2], 
                    TypeSystem`Vector[
                    TypeSystem`Vector[
                    TypeSystem`Atom[Real], 4], TypeSystem`AnyLength], 
                    TypeSystem`Vector[
                    TypeSystem`Atom[String], TypeSystem`AnyLength], 
                    TypeSystem`Atom[DateObject]}], 2]], Editable -> True, 
                    AutoDelete -> True]], "Input", FontTracking -> "Plain"], 
                  TooltipDelay -> 0.25], 
                 EventHandlerTag[{"MouseClicked" :> CellPrint[
                    Cell[
                    ToString[
                    TypeSystem`Vector[
                    
                    TypeSystem`Struct[{
                    "Type", "Dimensions", "BoundingBoxes", 
                    "BoundingBoxLabels", "ModifiedDate"}, {
                    TypeSystem`Atom[String], 
                    TypeSystem`Vector[
                    TypeSystem`Atom[Integer], 2], 
                    TypeSystem`Vector[
                    TypeSystem`Vector[
                    TypeSystem`Atom[Real], 4], TypeSystem`AnyLength], 
                    TypeSystem`Vector[
                    TypeSystem`Atom[String], TypeSystem`AnyLength], 
                    TypeSystem`Atom[DateObject]}], 2], InputForm], "Input"]], 
                   Method -> "Preemptive", PassEventsDown -> True, 
                   PassEventsUp -> False}]], FontTracking -> "Condensed", 
                FontWeight -> "Bold", SpanMinSize -> 1.3, SpanMaxSize -> 3.], 
               Deploy, DefaultBaseStyle -> "Deploy"], 
              MouseAppearanceTag["LinkHand"]], 
             TypeSystem`Vector[
              
              TypeSystem`Struct[{
               "Type", "Dimensions", "BoundingBoxes", "BoundingBoxLabels", 
                "ModifiedDate"}, {
                TypeSystem`Atom[String], 
                TypeSystem`Vector[
                 TypeSystem`Atom[Integer], 2], 
                TypeSystem`Vector[
                 TypeSystem`Vector[
                  TypeSystem`Atom[Real], 4], TypeSystem`AnyLength], 
                TypeSystem`Vector[
                 TypeSystem`Atom[String], TypeSystem`AnyLength], 
                TypeSystem`Atom[DateObject]}], 2]], TooltipDelay -> 1.5], 
           EventHandlerTag[{"MouseClicked" :> Print[
               InputForm[
                TypeSystem`Vector[
                 
                 TypeSystem`Struct[{
                  "Type", "Dimensions", "BoundingBoxes", "BoundingBoxLabels", 
                   "ModifiedDate"}, {
                   TypeSystem`Atom[String], 
                   TypeSystem`Vector[
                    TypeSystem`Atom[Integer], 2], 
                   TypeSystem`Vector[
                    TypeSystem`Vector[
                    TypeSystem`Atom[Real], 4], TypeSystem`AnyLength], 
                   TypeSystem`Vector[
                    TypeSystem`Atom[String], TypeSystem`AnyLength], 
                   TypeSystem`Atom[DateObject]}], 2]]]}]], 
          AdjustmentBox[" | ", BoxBaselineShift -> -0.3], 
          RowBox[{"2", "rows"}]}], 
        BaseStyle -> {
         FontFamily -> "Helvetica", FontSize -> 10, FontColor -> 
          GrayLevel[0.4], Editable -> False, Selectable -> False}, 
        ItemSize -> {Automatic, Automatic}, Alignment -> {Left, Center}, 
        Background -> RGBColor[0.92, 0.92, 0.9]], "\[SpanFromLeft]", 
       "\[SpanFromLeft]", "\[SpanFromLeft]", "\[SpanFromLeft]"}}, 
     GridBoxFrame -> {"ColumnsIndexed" -> {{{1, -1}, {1, -1}} -> True}}, 
     FrameStyle -> RGBColor[0, 0, 0, 0.4], GridBoxDividers -> {"Columns" -> {
         RGBColor[0, 0, 0, 0.4], {
          RGBColor[0, 0, 0, 0.09]}, 
         RGBColor[0, 0, 0, 0.4]}, "Rows" -> {
         RGBColor[0, 0, 0, 0.4], 
         RGBColor[0, 0, 0, 0.3], {
          RGBColor[0, 0, 0, 0.08]}, 
         RGBColor[0, 0, 0, 0.4]}}, RowSpacings -> {1.5, 1.2}, 
     GridBoxBackground -> {"Columns" -> {}, "Rows" -> {
         RGBColor[0.92, 0.92, 0.9]}}, 
     GridBoxAlignment -> {"Columns" -> {{Left}}}, ColumnSpacings -> 2.5, 
     GridFrameMargins -> {{2, 3}, {1, 3}}, 
     GridBoxItemSize -> {"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}},
      RowMinHeight -> 1.3],"Dataset[{__Association}]"},
   "Dataset",
   DisplayFunction->(TagBox[
     StyleBox[#, {
      ShowAutoStyles -> False, LineBreakWithin -> False, FontWeight -> 
       "Light", FontFamily -> "Helvetica Neue", NumberMarks -> False, 
       SpanMaxSize -> 3, SpanMinSize -> 1., Editable -> False, Selectable -> 
       True, Background -> RGBColor[0.985, 0.98, 0.973], 
       LinebreakAdjustments -> {0.4, 5, 100, 0, 0.5}, LineIndent -> 0, 
       LineSpacing -> {1.1, 5}}], Deploy]& ),
   InterpretationFunction->(#2& )],
  False,
  Editable->False,
  SelectWithContents->True,
  Selectable->False]], "Output"]
}, Open  ]],

Cell[CellGroupData[{

Cell["Insert them:", "Item"],

Cell[TextData[{
 StyleBox["Note:",
  FontWeight->"Bold"],
 " its more efficient to add documents in bulk, as CollectionInsert uses a \
specially optimized bulk_operation API for this case). We can insert JSON \
strings, associations, lists of associations (or json strings) and datasets. \
The only requirement at the moment is that the structure be JSONizable:"
}], "Subitem"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"CollectionInsert", "[", 
  RowBox[{"$testCollection", ",", "data"}], "]"}]], "Input"],

Cell[BoxData[
 RowBox[{"\[LeftAssociation]", 
  RowBox[{
   RowBox[{"\<\"nInserted\"\>", "\[Rule]", "2"}], ",", 
   RowBox[{"\<\"nMatched\"\>", "\[Rule]", "0"}], ",", 
   RowBox[{"\<\"nModified\"\>", "\[Rule]", "0"}], ",", 
   RowBox[{"\<\"nRemoved\"\>", "\[Rule]", "0"}], ",", 
   RowBox[{"\<\"nUpserted\"\>", "\[Rule]", "0"}], ",", 
   RowBox[{"\<\"writeErrors\"\>", "\[Rule]", 
    RowBox[{"{", "}"}]}]}], "\[RightAssociation]"}]], "Output"]
}, Open  ]]
}, Closed]],

Cell[CellGroupData[{

Cell["Reading + querying documents", "Subsection"],

Cell[CellGroupData[{

Cell["Counting", "Subsubsection"],

Cell["Count number of docs in collection:", "Item"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"CollectionCount", "@", "$testCollection"}]], "Input"],

Cell[BoxData["4"], "Output"]
}, Open  ]],

Cell[CellGroupData[{

Cell["\<\
Count number of docs in collection that contain a Hyena as a \
BoundingBoxLabels:\
\>", "Item"],

Cell[TextData[{
 "MongoDB has a fairly rich and simple query language (see ",
 ButtonBox["here for more).",
  BaseStyle->"Hyperlink",
  ButtonData->{
    URL["https://docs.mongodb.org/manual/tutorial/query-documents/"], None},
  ButtonNote->"https://docs.mongodb.org/manual/tutorial/query-documents/"]
}], "Subitem"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"CollectionCount", "[", 
  RowBox[{"$testCollection", ",", 
   RowBox[{"<|", 
    RowBox[{"\"\<BoundingBoxLabels\>\"", "\[Rule]", " ", "\"\<Hyena\>\""}], 
    "|>"}]}], "]"}]], "Input"],

Cell[BoxData["2"], "Output"]
}, Open  ]]
}, Open  ]],

Cell[CellGroupData[{

Cell["Reading", "Subsubsection"],

Cell["\<\
Create cursor that iterates over all docs in the collection:\
\>", "Item"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"iter", "=", 
  RowBox[{"CollectionFind", "[", "$testCollection", "]"}]}]], "Input"],

Cell[BoxData[
 InterpretationBox[
  RowBox[{"Cursor", "[", 
   TagBox[GridBox[{
      {
       StyleBox["MongoCursor", "Text",
        StripOnInput->False], "\[SpanFromLeft]"},
      {
       StyleBox["\<\"iter\"\>",
        StripOnInput->False,
        LineColor->RGBColor[0, 
          Rational[2, 3], 0],
        FrontFaceColor->RGBColor[0, 
          Rational[2, 3], 0],
        BackFaceColor->RGBColor[0, 
          Rational[2, 3], 0],
        GraphicsColor->RGBColor[0, 
          Rational[2, 3], 0],
        FontSlant->Italic,
        FontColor->RGBColor[0, 
          Rational[2, 3], 0]], 
       TagBox[
        RowBox[{"MongoCursor", "[", "1", "]"}],
        Short]}
     },
     AutoDelete->False,
     FrameStyle->GrayLevel[0.85],
     GridBoxAlignment->{"Columns" -> {{Left}}},
     GridBoxBackground->{"Columns" -> {{
          GrayLevel[1]}}},
     GridBoxDividers->{"Columns" -> {{True}}, "Rows" -> {{True}}},
     GridBoxItemSize->{"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}},
     GridBoxItemStyle->{"Columns" -> {{"Output"}}, "Rows" -> {{"Output"}}},
     GridBoxSpacings->{"Columns" -> {{1}}, "Rows" -> {{1}}}],
    "Grid"], "]"}],
  GeneralUtilities`Cursor[MongoLink`MongoCursor, 
   Replace[
    Cursors`iter$3[], $Failed :> GeneralUtilities`CursorExhausted], 
   None]]], "Output"]
}, Open  ]],

Cell["Read doc by doc:", "Item"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Read", "@", "iter"}]], "Input"],

Cell[BoxData[
 RowBox[{"\[LeftAssociation]", 
  RowBox[{
   RowBox[{"\<\"_id\"\>", "\[Rule]", 
    RowBox[{"MongoObjectID", "[", "\<\"56d59a77d682ee0f80587401\"\>", "]"}]}],
    ",", 
   RowBox[{"\<\"Type\"\>", "\[Rule]", "\<\"Image\"\>"}], ",", 
   RowBox[{"\<\"Dimensions\"\>", "\[Rule]", 
    RowBox[{"{", 
     RowBox[{"288", ",", "299"}], "}"}]}], ",", 
   RowBox[{"\<\"BoundingBoxes\"\>", "\[Rule]", 
    RowBox[{"{", 
     RowBox[{
      RowBox[{"{", 
       RowBox[{"1", ",", "3.3`", ",", "6.6`", ",", "2.3`"}], "}"}], ",", 
      RowBox[{"{", 
       RowBox[{"4.6`", ",", "3.4`", ",", "2.2`", ",", "7"}], "}"}]}], "}"}]}],
    ",", 
   RowBox[{"\<\"BoundingBoxLabels\"\>", "\[Rule]", 
    RowBox[{"{", 
     RowBox[{"\<\"Dog\"\>", ",", "\<\"Lion\"\>"}], "}"}]}], ",", 
   RowBox[{"\<\"ModifiedDate\"\>", 
    "\[Rule]", "\<\"                     12\\n<|$date -> 1.45684 10  \
|>\"\>"}]}], "\[RightAssociation]"}]], "Output"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Read", "@", "iter"}]], "Input"],

Cell[BoxData[
 RowBox[{"\[LeftAssociation]", 
  RowBox[{
   RowBox[{"\<\"_id\"\>", "\[Rule]", 
    RowBox[{"MongoObjectID", "[", "\<\"56d59a77d682ee0f80587402\"\>", "]"}]}],
    ",", 
   RowBox[{"\<\"Type\"\>", "\[Rule]", "\<\"Image\"\>"}], ",", 
   RowBox[{"\<\"Dimensions\"\>", "\[Rule]", 
    RowBox[{"{", 
     RowBox[{"234", ",", "334"}], "}"}]}], ",", 
   RowBox[{"\<\"BoundingBoxes\"\>", "\[Rule]", 
    RowBox[{"{", 
     RowBox[{"{", 
      RowBox[{"0.3`", ",", "6.7`", ",", "6.6`", ",", "2.3`"}], "}"}], "}"}]}],
    ",", 
   RowBox[{"\<\"BoundingBoxLabels\"\>", "\[Rule]", 
    RowBox[{"{", "\<\"Hyena\"\>", "}"}]}], ",", 
   RowBox[{"\<\"ModifiedDate\"\>", 
    "\[Rule]", "\<\"                     12\\n<|$date -> 1.45684 10  \
|>\"\>"}]}], "\[RightAssociation]"}]], "Output"]
}, Open  ]],

Cell["If nothing is left to cursor over:", "Item"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Read", "@", "iter"}]], "Input"],

Cell[BoxData["CursorExhausted"], "Output"]
}, Open  ]],

Cell[CellGroupData[{

Cell["\<\
Get all docs (use ReadList) whose first image dimension is greater than 250:\
\>", "Item"],

Cell["\<\
Note that Mongo uses 0 indexing for arrays and that special op $gt is used \
for >:\
\>", "Subitem"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"Dataset", "@", 
   RowBox[{"ReadList", "@", 
    RowBox[{"CollectionFind", "[", 
     RowBox[{"$testCollection", ",", " ", 
      RowBox[{"<|", 
       RowBox[{"\"\<Dimensions.0\>\"", " ", "\[Rule]", " ", 
        RowBox[{"<|", 
         RowBox[{"\"\<$gt\>\"", "\[Rule]", " ", "250"}], "|>"}]}], "|>"}]}], 
     " ", "]"}]}]}], "\[IndentingNewLine]"}]], "Input"],

Cell[BoxData[
 TagBox[
  TemplateBox[{GridBox[{{
       StyleBox["\"_id\"", 
        GrayLevel[0.3]], 
       StyleBox["\"Type\"", 
        GrayLevel[0.3]], 
       StyleBox["\"Dimensions\"", 
        GrayLevel[0.3]], 
       StyleBox["\"BoundingBoxes\"", 
        GrayLevel[0.3]], 
       StyleBox["\"BoundingBoxLabels\"", 
        GrayLevel[0.3]], 
       StyleBox["\"ModifiedDate\"", 
        GrayLevel[0.3]]}, {
       InterpretationBox[
        TagBox[
         RowBox[{"MongoObjectID", "[", "\"56d59a77d682ee0f80587401\"", "]"}], 
         Short[#, 5]& ], 
        MongoLink`MongoObjectID["56d59a77d682ee0f80587401"]], 
       StyleBox["\"Image\"", FontColor -> GrayLevel[0.4]], 
       StyleBox[
        RowBox[{"{", "\[ThinSpace]", 288, ",", 299, "\[ThinSpace]", "}"}], 
        LineBreakWithin -> Automatic], 
       StyleBox[
        RowBox[{"{", "\[ThinSpace]", 
          RowBox[{"{", 
            StyleBox[
             SubscriptBox["\[CenterEllipsis]", "4"], 
             GrayLevel[0.5]], "}"}], ",", 
          RowBox[{"{", 
            StyleBox[
             SubscriptBox["\[CenterEllipsis]", "4"], 
             GrayLevel[0.5]], "}"}], "\[ThinSpace]", "}"}], LineBreakWithin -> 
        Automatic], 
       StyleBox[
        RowBox[{"{", "\[ThinSpace]", 
          StyleBox["\"Dog\"", FontColor -> GrayLevel[0.4]], ",", 
          StyleBox["\"Lion\"", FontColor -> GrayLevel[0.4]], "\[ThinSpace]", 
          "}"}], LineBreakWithin -> Automatic], 
       StyleBox[
       "\"                     12\\n<|$date -> 1.45684 10  |>\"", FontColor -> 
        GrayLevel[0.4]]}, {
       ItemBox[
        RowBox[{
          TagBox[
           TooltipBox["4 levels", 
            InterpretationBox[
             TagBox[
              TagBox[
               StyleBox[
                TagBox[
                 TooltipBox[
                  SubscriptBox[
                   RowBox[{"{", 
                    RowBox[{
                    TagBox[
                    TooltipBox[
                    FrameBox[
                    RowBox[{"\[LeftAssociation]", 
                    RowBox[{
                    RowBox[{
                    StyleBox[
                    "_id", FontColor -> RGBColor[0.6, 0.4, 0.2], FontFamily -> 
                    "Verdana", FontWeight -> Normal], 
                    StyleBox[
                    "\[Rule]", FontColor -> GrayLevel[0.65], FontWeight -> 
                    "Thin"], 
                    TagBox[
                    TooltipBox[
                    FrameBox[
                    StyleBox["Any", FontColor -> RGBColor[
                    Rational[2, 3], 0, 0], FontFamily -> "Monaco"], 
                    FrameStyle -> Dynamic[
                    If[
                    CurrentValue["MouseOver"], 
                    GrayLevel[0.9], None]], BaselinePosition -> Baseline, 
                    FrameMargins -> {{0, 0}, {2, 2}}, ContentPadding -> 
                    False], 
                    Cell[
                    BoxData[
                    InterpretationBox[
                    StyleBox[
                    "TypeSystem`AnyType", ShowStringCharacters -> True, 
                    NumberMarks -> True], 
                    InputForm[TypeSystem`AnyType], Editable -> True, 
                    AutoDelete -> True]], "Input", FontTracking -> "Plain"], 
                    TooltipDelay -> 0.25], 
                    EventHandlerTag[{"MouseClicked" :> CellPrint[
                    Cell[
                    ToString[TypeSystem`AnyType, InputForm], "Input"]], 
                    Method -> "Preemptive", PassEventsDown -> True, 
                    PassEventsUp -> False}]]}], 
                    StyleBox[
                    ",", FontColor -> GrayLevel[0.65], FontWeight -> "Thin"], 
                    
                    RowBox[{
                    StyleBox[
                    "Type", FontColor -> RGBColor[0.6, 0.4, 0.2], FontFamily -> 
                    "Verdana", FontWeight -> Normal], 
                    StyleBox[
                    "\[Rule]", FontColor -> GrayLevel[0.65], FontWeight -> 
                    "Thin"], 
                    TagBox[
                    TooltipBox[
                    FrameBox[
                    StyleBox["Str", FontColor -> RGBColor[0, 
                    Rational[2, 3], 0], FontFamily -> "Monaco"], FrameStyle -> 
                    Dynamic[
                    If[
                    CurrentValue["MouseOver"], 
                    GrayLevel[0.9], None]], BaselinePosition -> Baseline, 
                    FrameMargins -> {{0, 0}, {2, 2}}, ContentPadding -> 
                    False], 
                    Cell[
                    BoxData[
                    InterpretationBox[
                    StyleBox[
                    "TypeSystem`Atom[String]", ShowStringCharacters -> True, 
                    NumberMarks -> True], 
                    InputForm[
                    TypeSystem`Atom[String]], Editable -> True, AutoDelete -> 
                    True]], "Input", FontTracking -> "Plain"], TooltipDelay -> 
                    0.25], 
                    EventHandlerTag[{"MouseClicked" :> CellPrint[
                    Cell[
                    ToString[
                    TypeSystem`Atom[String], InputForm], "Input"]], Method -> 
                    "Preemptive", PassEventsDown -> True, PassEventsUp -> 
                    False}]]}], 
                    StyleBox[
                    ",", FontColor -> GrayLevel[0.65], FontWeight -> "Thin"], 
                    
                    RowBox[{
                    StyleBox[
                    "Dimensions", FontColor -> RGBColor[0.6, 0.4, 0.2], 
                    FontFamily -> "Verdana", FontWeight -> Normal], 
                    StyleBox[
                    "\[Rule]", FontColor -> GrayLevel[0.65], FontWeight -> 
                    "Thin"], 
                    TagBox[
                    TooltipBox[
                    FrameBox[
                    SubscriptBox[
                    RowBox[{"{", 
                    RowBox[{
                    TagBox[
                    TooltipBox[
                    FrameBox[
                    StyleBox["Int", FontColor -> RGBColor[0, 
                    Rational[2, 3], 0], FontFamily -> "Monaco"], FrameStyle -> 
                    Dynamic[
                    If[
                    CurrentValue["MouseOver"], 
                    GrayLevel[0.9], None]], BaselinePosition -> Baseline, 
                    FrameMargins -> {{0, 0}, {2, 2}}, ContentPadding -> 
                    False], 
                    Cell[
                    BoxData[
                    InterpretationBox[
                    StyleBox[
                    "TypeSystem`Atom[Integer]", ShowStringCharacters -> True, 
                    NumberMarks -> True], 
                    InputForm[
                    TypeSystem`Atom[Integer]], Editable -> True, AutoDelete -> 
                    True]], "Input", FontTracking -> "Plain"], TooltipDelay -> 
                    0.25], 
                    EventHandlerTag[{"MouseClicked" :> CellPrint[
                    Cell[
                    ToString[
                    TypeSystem`Atom[Integer], InputForm], "Input"]], Method -> 
                    "Preemptive", PassEventsDown -> True, PassEventsUp -> 
                    False}]]}], "}"}], 
                    StyleBox[
                    "2", FontFamily -> "Arial", FontWeight -> Normal]], 
                    FrameStyle -> Dynamic[
                    If[
                    CurrentValue["MouseOver"], 
                    GrayLevel[0.9], None]], BaselinePosition -> Baseline, 
                    FrameMargins -> {{0, 0}, {2, 2}}, ContentPadding -> 
                    False], 
                    Cell[
                    BoxData[
                    InterpretationBox[
                    StyleBox[
                    "TypeSystem`Vector[TypeSystem`Atom[Integer], 2]", 
                    ShowStringCharacters -> True, NumberMarks -> True], 
                    InputForm[
                    TypeSystem`Vector[
                    TypeSystem`Atom[Integer], 2]], Editable -> True, 
                    AutoDelete -> True]], "Input", FontTracking -> "Plain"], 
                    TooltipDelay -> 0.25], 
                    EventHandlerTag[{"MouseClicked" :> CellPrint[
                    Cell[
                    ToString[
                    TypeSystem`Vector[
                    TypeSystem`Atom[Integer], 2], InputForm], "Input"]], 
                    Method -> "Preemptive", PassEventsDown -> True, 
                    PassEventsUp -> False}]]}], 
                    StyleBox[
                    ",", FontColor -> GrayLevel[0.65], FontWeight -> "Thin"], 
                    
                    RowBox[{
                    StyleBox[
                    "BoundingBoxes", FontColor -> RGBColor[0.6, 0.4, 0.2], 
                    FontFamily -> "Verdana", FontWeight -> Normal], 
                    StyleBox[
                    "\[Rule]", FontColor -> GrayLevel[0.65], FontWeight -> 
                    "Thin"], 
                    TagBox[
                    TooltipBox[
                    FrameBox[
                    SubscriptBox[
                    RowBox[{"{", 
                    RowBox[{
                    TagBox[
                    TooltipBox[
                    FrameBox[
                    SubscriptBox[
                    RowBox[{"{", 
                    RowBox[{
                    TagBox[
                    TooltipBox[
                    FrameBox[
                    StyleBox["Real", FontColor -> RGBColor[0, 
                    Rational[2, 3], 0], FontFamily -> "Monaco"], FrameStyle -> 
                    Dynamic[
                    If[
                    CurrentValue["MouseOver"], 
                    GrayLevel[0.9], None]], BaselinePosition -> Baseline, 
                    FrameMargins -> {{0, 0}, {2, 2}}, ContentPadding -> 
                    False], 
                    Cell[
                    BoxData[
                    InterpretationBox[
                    StyleBox[
                    "TypeSystem`Atom[Real]", ShowStringCharacters -> True, 
                    NumberMarks -> True], 
                    InputForm[
                    TypeSystem`Atom[Real]], Editable -> True, AutoDelete -> 
                    True]], "Input", FontTracking -> "Plain"], TooltipDelay -> 
                    0.25], 
                    EventHandlerTag[{"MouseClicked" :> CellPrint[
                    Cell[
                    ToString[
                    TypeSystem`Atom[Real], InputForm], "Input"]], Method -> 
                    "Preemptive", PassEventsDown -> True, PassEventsUp -> 
                    False}]]}], "}"}], 
                    StyleBox[
                    "4", FontFamily -> "Arial", FontWeight -> Normal]], 
                    FrameStyle -> Dynamic[
                    If[
                    CurrentValue["MouseOver"], 
                    GrayLevel[0.9], None]], BaselinePosition -> Baseline, 
                    FrameMargins -> {{0, 0}, {2, 2}}, ContentPadding -> 
                    False], 
                    Cell[
                    BoxData[
                    InterpretationBox[
                    StyleBox[
                    "TypeSystem`Vector[TypeSystem`Atom[Real], 4]", 
                    ShowStringCharacters -> True, NumberMarks -> True], 
                    InputForm[
                    TypeSystem`Vector[
                    TypeSystem`Atom[Real], 4]], Editable -> True, AutoDelete -> 
                    True]], "Input", FontTracking -> "Plain"], TooltipDelay -> 
                    0.25], 
                    EventHandlerTag[{"MouseClicked" :> CellPrint[
                    Cell[
                    ToString[
                    TypeSystem`Vector[
                    TypeSystem`Atom[Real], 4], InputForm], "Input"]], Method -> 
                    "Preemptive", PassEventsDown -> True, PassEventsUp -> 
                    False}]]}], "}"}], 
                    StyleBox[
                    "2", FontFamily -> "Arial", FontWeight -> Normal]], 
                    FrameStyle -> Dynamic[
                    If[
                    CurrentValue["MouseOver"], 
                    GrayLevel[0.9], None]], BaselinePosition -> Baseline, 
                    FrameMargins -> {{0, 0}, {2, 2}}, ContentPadding -> 
                    False], 
                    Cell[
                    BoxData[
                    InterpretationBox[
                    StyleBox[
                    "TypeSystem`Vector[TypeSystem`Vector[TypeSystem`Atom[Real]\
, 4], 2]", ShowStringCharacters -> True, NumberMarks -> True], 
                    InputForm[
                    TypeSystem`Vector[
                    TypeSystem`Vector[
                    TypeSystem`Atom[Real], 4], 2]], Editable -> True, 
                    AutoDelete -> True]], "Input", FontTracking -> "Plain"], 
                    TooltipDelay -> 0.25], 
                    EventHandlerTag[{"MouseClicked" :> CellPrint[
                    Cell[
                    ToString[
                    TypeSystem`Vector[
                    TypeSystem`Vector[
                    TypeSystem`Atom[Real], 4], 2], InputForm], "Input"]], 
                    Method -> "Preemptive", PassEventsDown -> True, 
                    PassEventsUp -> False}]]}], 
                    StyleBox[
                    ",", FontColor -> GrayLevel[0.65], FontWeight -> "Thin"], 
                    
                    RowBox[{
                    StyleBox[
                    "BoundingBoxLabels", FontColor -> RGBColor[0.6, 0.4, 0.2],
                     FontFamily -> "Verdana", FontWeight -> Normal], 
                    StyleBox[
                    "\[Rule]", FontColor -> GrayLevel[0.65], FontWeight -> 
                    "Thin"], 
                    TagBox[
                    TooltipBox[
                    FrameBox[
                    SubscriptBox[
                    RowBox[{"{", 
                    RowBox[{
                    TagBox[
                    TooltipBox[
                    FrameBox[
                    StyleBox["Str", FontColor -> RGBColor[0, 
                    Rational[2, 3], 0], FontFamily -> "Monaco"], FrameStyle -> 
                    Dynamic[
                    If[
                    CurrentValue["MouseOver"], 
                    GrayLevel[0.9], None]], BaselinePosition -> Baseline, 
                    FrameMargins -> {{0, 0}, {2, 2}}, ContentPadding -> 
                    False], 
                    Cell[
                    BoxData[
                    InterpretationBox[
                    StyleBox[
                    "TypeSystem`Atom[String]", ShowStringCharacters -> True, 
                    NumberMarks -> True], 
                    InputForm[
                    TypeSystem`Atom[String]], Editable -> True, AutoDelete -> 
                    True]], "Input", FontTracking -> "Plain"], TooltipDelay -> 
                    0.25], 
                    EventHandlerTag[{"MouseClicked" :> CellPrint[
                    Cell[
                    ToString[
                    TypeSystem`Atom[String], InputForm], "Input"]], Method -> 
                    "Preemptive", PassEventsDown -> True, PassEventsUp -> 
                    False}]]}], "}"}], 
                    StyleBox["2", FontFamily -> "Arial", FontWeight -> 
                    Normal]], FrameStyle -> Dynamic[
                    If[
                    CurrentValue["MouseOver"], 
                    GrayLevel[0.9], None]], BaselinePosition -> Baseline, 
                    FrameMargins -> {{0, 0}, {2, 2}}, ContentPadding -> 
                    False], 
                    Cell[
                    BoxData[
                    InterpretationBox[
                    StyleBox[
                    "TypeSystem`Vector[TypeSystem`Atom[String], 2]", 
                    ShowStringCharacters -> True, NumberMarks -> True], 
                    InputForm[
                    TypeSystem`Vector[
                    TypeSystem`Atom[String], 2]], Editable -> True, 
                    AutoDelete -> True]], "Input", FontTracking -> "Plain"], 
                    TooltipDelay -> 0.25], 
                    EventHandlerTag[{"MouseClicked" :> CellPrint[
                    Cell[
                    ToString[
                    TypeSystem`Vector[
                    TypeSystem`Atom[String], 2], InputForm], "Input"]], 
                    Method -> "Preemptive", PassEventsDown -> True, 
                    PassEventsUp -> False}]]}], 
                    StyleBox[
                    ",", FontColor -> GrayLevel[0.65], FontWeight -> "Thin"], 
                    
                    RowBox[{
                    StyleBox[
                    "ModifiedDate", FontColor -> RGBColor[0.6, 0.4, 0.2], 
                    FontFamily -> "Verdana", FontWeight -> Normal], 
                    StyleBox[
                    "\[Rule]", FontColor -> GrayLevel[0.65], FontWeight -> 
                    "Thin"], 
                    TagBox[
                    TooltipBox[
                    FrameBox[
                    StyleBox["Str", FontColor -> RGBColor[0, 
                    Rational[2, 3], 0], FontFamily -> "Monaco"], FrameStyle -> 
                    Dynamic[
                    If[
                    CurrentValue["MouseOver"], 
                    GrayLevel[0.9], None]], BaselinePosition -> Baseline, 
                    FrameMargins -> {{0, 0}, {2, 2}}, ContentPadding -> 
                    False], 
                    Cell[
                    BoxData[
                    InterpretationBox[
                    StyleBox[
                    "TypeSystem`Atom[String]", ShowStringCharacters -> True, 
                    NumberMarks -> True], 
                    InputForm[
                    TypeSystem`Atom[String]], Editable -> True, AutoDelete -> 
                    True]], "Input", FontTracking -> "Plain"], TooltipDelay -> 
                    0.25], 
                    EventHandlerTag[{"MouseClicked" :> CellPrint[
                    Cell[
                    ToString[
                    TypeSystem`Atom[String], InputForm], "Input"]], Method -> 
                    "Preemptive", PassEventsDown -> True, PassEventsUp -> 
                    False}]]}]}], "\[RightAssociation]"}], FrameStyle -> 
                    Dynamic[
                    If[
                    CurrentValue["MouseOver"], 
                    GrayLevel[0.9], None]], BaselinePosition -> Baseline, 
                    FrameMargins -> {{0, 0}, {2, 2}}, ContentPadding -> 
                    False], 
                    Cell[
                    BoxData[
                    InterpretationBox[
                    StyleBox[
                    "TypeSystem`Struct[{\"_id\", \"Type\", \"Dimensions\", \
\"BoundingBoxes\", \"BoundingBoxLabels\", \"ModifiedDate\"}, \
{TypeSystem`AnyType, TypeSystem`Atom[String], \
TypeSystem`Vector[TypeSystem`Atom[Integer], 2], \
TypeSystem`Vector[TypeSystem`Vector[TypeSystem`Atom[Real], 4], 2], \
TypeSystem`Vector[TypeSystem`Atom[String], 2], TypeSystem`Atom[String]}]", 
                    ShowStringCharacters -> True, NumberMarks -> True], 
                    InputForm[
                    
                    TypeSystem`Struct[{
                    "_id", "Type", "Dimensions", "BoundingBoxes", 
                    "BoundingBoxLabels", "ModifiedDate"}, {TypeSystem`AnyType, 
                    TypeSystem`Atom[String], 
                    TypeSystem`Vector[
                    TypeSystem`Atom[Integer], 2], 
                    TypeSystem`Vector[
                    TypeSystem`Vector[
                    TypeSystem`Atom[Real], 4], 2], 
                    TypeSystem`Vector[
                    TypeSystem`Atom[String], 2], 
                    TypeSystem`Atom[String]}]], Editable -> True, AutoDelete -> 
                    True]], "Input", FontTracking -> "Plain"], TooltipDelay -> 
                    0.25], 
                    EventHandlerTag[{"MouseClicked" :> CellPrint[
                    Cell[
                    ToString[
                    
                    TypeSystem`Struct[{
                    "_id", "Type", "Dimensions", "BoundingBoxes", 
                    "BoundingBoxLabels", "ModifiedDate"}, {TypeSystem`AnyType, 
                    TypeSystem`Atom[String], 
                    TypeSystem`Vector[
                    TypeSystem`Atom[Integer], 2], 
                    TypeSystem`Vector[
                    TypeSystem`Vector[
                    TypeSystem`Atom[Real], 4], 2], 
                    TypeSystem`Vector[
                    TypeSystem`Atom[String], 2], 
                    TypeSystem`Atom[String]}], InputForm], "Input"]], Method -> 
                    "Preemptive", PassEventsDown -> True, PassEventsUp -> 
                    False}]]}], "}"}], 
                   StyleBox[
                   "1", FontFamily -> "Arial", FontWeight -> Normal]], 
                  Cell[
                   BoxData[
                    InterpretationBox[
                    StyleBox[
                    "TypeSystem`Vector[TypeSystem`Struct[{\"_id\", \"Type\", \
\"Dimensions\", \"BoundingBoxes\", \"BoundingBoxLabels\", \"ModifiedDate\"}, \
{TypeSystem`AnyType, TypeSystem`Atom[String], \
TypeSystem`Vector[TypeSystem`Atom[Integer], 2], \
TypeSystem`Vector[TypeSystem`Vector[TypeSystem`Atom[Real], 4], 2], \
TypeSystem`Vector[TypeSystem`Atom[String], 2], TypeSystem`Atom[String]}], 1]",
                     ShowStringCharacters -> True, NumberMarks -> True], 
                    InputForm[
                    TypeSystem`Vector[
                    
                    TypeSystem`Struct[{
                    "_id", "Type", "Dimensions", "BoundingBoxes", 
                    "BoundingBoxLabels", "ModifiedDate"}, {TypeSystem`AnyType, 
                    TypeSystem`Atom[String], 
                    TypeSystem`Vector[
                    TypeSystem`Atom[Integer], 2], 
                    TypeSystem`Vector[
                    TypeSystem`Vector[
                    TypeSystem`Atom[Real], 4], 2], 
                    TypeSystem`Vector[
                    TypeSystem`Atom[String], 2], 
                    TypeSystem`Atom[String]}], 1]], Editable -> True, 
                    AutoDelete -> True]], "Input", FontTracking -> "Plain"], 
                  TooltipDelay -> 0.25], 
                 EventHandlerTag[{"MouseClicked" :> CellPrint[
                    Cell[
                    ToString[
                    TypeSystem`Vector[
                    
                    TypeSystem`Struct[{
                    "_id", "Type", "Dimensions", "BoundingBoxes", 
                    "BoundingBoxLabels", "ModifiedDate"}, {TypeSystem`AnyType, 
                    TypeSystem`Atom[String], 
                    TypeSystem`Vector[
                    TypeSystem`Atom[Integer], 2], 
                    TypeSystem`Vector[
                    TypeSystem`Vector[
                    TypeSystem`Atom[Real], 4], 2], 
                    TypeSystem`Vector[
                    TypeSystem`Atom[String], 2], 
                    TypeSystem`Atom[String]}], 1], InputForm], "Input"]], 
                   Method -> "Preemptive", PassEventsDown -> True, 
                   PassEventsUp -> False}]], FontTracking -> "Condensed", 
                FontWeight -> "Bold", SpanMinSize -> 1.3, SpanMaxSize -> 3.], 
               Deploy, DefaultBaseStyle -> "Deploy"], 
              MouseAppearanceTag["LinkHand"]], 
             TypeSystem`Vector[
              
              TypeSystem`Struct[{
               "_id", "Type", "Dimensions", "BoundingBoxes", 
                "BoundingBoxLabels", "ModifiedDate"}, {TypeSystem`AnyType, 
                TypeSystem`Atom[String], 
                TypeSystem`Vector[
                 TypeSystem`Atom[Integer], 2], 
                TypeSystem`Vector[
                 TypeSystem`Vector[
                  TypeSystem`Atom[Real], 4], 2], 
                TypeSystem`Vector[
                 TypeSystem`Atom[String], 2], 
                TypeSystem`Atom[String]}], 1]], TooltipDelay -> 1.5], 
           EventHandlerTag[{"MouseClicked" :> Print[
               InputForm[
                TypeSystem`Vector[
                 
                 TypeSystem`Struct[{
                  "_id", "Type", "Dimensions", "BoundingBoxes", 
                   "BoundingBoxLabels", "ModifiedDate"}, {
                  TypeSystem`AnyType, 
                   TypeSystem`Atom[String], 
                   TypeSystem`Vector[
                    TypeSystem`Atom[Integer], 2], 
                   TypeSystem`Vector[
                    TypeSystem`Vector[
                    TypeSystem`Atom[Real], 4], 2], 
                   TypeSystem`Vector[
                    TypeSystem`Atom[String], 2], 
                   TypeSystem`Atom[String]}], 1]]]}]], 
          AdjustmentBox[" | ", BoxBaselineShift -> -0.3], 
          RowBox[{"1", "rows"}]}], 
        BaseStyle -> {
         FontFamily -> "Helvetica", FontSize -> 10, FontColor -> 
          GrayLevel[0.4], Editable -> False, Selectable -> False}, 
        ItemSize -> {Automatic, Automatic}, Alignment -> {Left, Center}, 
        Background -> RGBColor[0.92, 0.92, 0.9]], "\[SpanFromLeft]", 
       "\[SpanFromLeft]", "\[SpanFromLeft]", "\[SpanFromLeft]", 
       "\[SpanFromLeft]"}}, 
     GridBoxFrame -> {"ColumnsIndexed" -> {{{1, -1}, {1, -1}} -> True}}, 
     FrameStyle -> RGBColor[0, 0, 0, 0.4], GridBoxDividers -> {"Columns" -> {
         RGBColor[0, 0, 0, 0.4], {
          RGBColor[0, 0, 0, 0.09]}, 
         RGBColor[0, 0, 0, 0.4]}, "Rows" -> {
         RGBColor[0, 0, 0, 0.4], 
         RGBColor[0, 0, 0, 0.3], {
          RGBColor[0, 0, 0, 0.08]}, 
         RGBColor[0, 0, 0, 0.4]}}, RowSpacings -> {1.5, 1.2}, 
     GridBoxBackground -> {"Columns" -> {}, "Rows" -> {
         RGBColor[0.92, 0.92, 0.9]}}, 
     GridBoxAlignment -> {"Columns" -> {{Left}}}, ColumnSpacings -> 2.5, 
     GridFrameMargins -> {{2, 3}, {1, 3}}, 
     GridBoxItemSize -> {"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}},
      RowMinHeight -> 1.3],"Dataset[{__Association}]"},
   "Dataset",
   DisplayFunction->(TagBox[
     StyleBox[#, {
      ShowAutoStyles -> False, LineBreakWithin -> False, FontWeight -> 
       "Light", FontFamily -> "Helvetica Neue", NumberMarks -> False, 
       SpanMaxSize -> 3, SpanMinSize -> 1., Editable -> False, Selectable -> 
       True, Background -> RGBColor[0.985, 0.98, 0.973], 
       LinebreakAdjustments -> {0.4, 5, 100, 0, 0.5}, LineIndent -> 0, 
       LineSpacing -> {1.1, 5}}], Deploy]& ),
   InterpretationFunction->(#2& )],
  False,
  Editable->False,
  SelectWithContents->True,
  Selectable->False]], "Output"]
}, Open  ]]
}, Open  ]],

Cell[CellGroupData[{

Cell["MongoObjectID", "Subsubsection"],

Cell["\<\
A note about MongoObjectID: this is an automatically generated unique ID that \
MongoDB creates when you insert Documents. It contains a bunch of info, like \
the servers clock time when the Document was created, the ID of the machine \
which created the Document, etc:\
\>", "Item"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"MongoObjectID", "[", "\"\<56b88a74d682ee08887278f0\>\"", "]"}], "//",
   "Normal"}]], "Input",
 CellChangeTimes->{{3.663936675217455*^9, 3.663936678093801*^9}}],

Cell[BoxData[
 RowBox[{"\[LeftAssociation]", 
  RowBox[{
   RowBox[{"\<\"GenerationTime\"\>", "\[Rule]", 
    TemplateBox[{RowBox[{"\"Mon 8 Feb 2016 14:30:44\"", 
        StyleBox[
         RowBox[{"\"GMT+\"", "\[InvisibleSpace]", "2.`"}], FontColor -> 
         GrayLevel[0.5]]}],RowBox[{"DateObject", "[", 
        RowBox[{
          RowBox[{"{", 
            RowBox[{"2016", ",", "2", ",", "8"}], "}"}], ",", 
          RowBox[{"TimeObject", "[", 
            RowBox[{
              RowBox[{"{", 
                RowBox[{"14", ",", "30", ",", "44.`"}], "}"}], ",", 
              RowBox[{"TimeZone", "\[Rule]", "2.`"}]}], "]"}], ",", 
          RowBox[{"TimeZone", "\[Rule]", "2.`"}]}], "]"}]},
     "DateObject",
     Editable->False]}], ",", 
   RowBox[{"\<\"MachineID\"\>", "\[Rule]", "14058222"}], ",", 
   RowBox[{"\<\"ProcessID\"\>", "\[Rule]", "2184"}], ",", 
   RowBox[{"\<\"Counter\"\>", "\[Rule]", "7502064"}]}], 
  "\[RightAssociation]"}]], "Output"]
}, Open  ]]
}, Open  ]]
}, Closed]],

Cell[CellGroupData[{

Cell["Modifying Documents", "Subsection"],

Cell[CellGroupData[{

Cell["CollectionUpdate", "Subsubsection"],

Cell[CellGroupData[{

Cell["\<\
This is a dangerous operation, as you can\[CloseCurlyQuote]t easily undo \
modifications.\
\>", "Item"],

Cell[CellGroupData[{

Cell["\<\
Always first use CollectionFind to ensure that your query is correct.\
\>", "Subitem"],

Cell["Read the doc carefully:", "Subitem"]
}, Open  ]]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"?", "CollectionUpdate"}]], "Input"],

Cell[BoxData[
 StyleBox["\<\"\!\(\*RowBox[{\\\"CollectionUpdate\\\", \\\"[\\\", \
RowBox[{RowBox[{\\\"MongoCollection\\\", \\\"[\\\", RowBox[{StyleBox[\\\"\
\[Ellipsis]\\\", \\\"TR\\\"]}], \\\"]\\\"}], \\\",\\\",  StyleBox[\\\"query\\\
\", \\\"TI\\\"], \\\",\\\",  StyleBox[\\\"update\\\", \\\"TI\\\"]}], \
\\\"]\\\"}]\)\[VeryThinSpace] update a single document in the collection \
MongoCollection[\[Ellipsis]] which satisfies the \
\!\(\*StyleBox[\\\"query\\\", \\\"TI\\\"]\)\[VeryThinSpace] association. The \
\!\(\*StyleBox[\\\"update\\\", \\\"TI\\\"]\)\[VeryThinSpace] document will \
replace the contents of the matched document (exept for _id field). To update \
only individual fields, use the $set operator. If no document satisfies \
\!\(\*StyleBox[\\\"query\\\", \\\"TI\\\"]\)\[VeryThinSpace], nothing is done, \
unless the Option \\\"Upsert\\\" is set to True. To update all documents \
satisfying the \!\(\*StyleBox[\\\"query\\\", \\\"TI\\\"]\)\[VeryThinSpace], \
set the option \\\"Multi\\\" to True.\"\>", "MSG"]], "Print", "PrintUsage",
 CellTags->"Info983665842172-2073150"]
}, Open  ]],

Cell[CellGroupData[{

Cell["\<\
Lets set the image dimensions of all documents containing a Hyena in \
BoundingBoxLabels to {2, 2}:\
\>", "Item"],

Cell[TextData[{
 "Use the $set operator to only change certain fields. ",
 ButtonBox["See here",
  BaseStyle->"Hyperlink",
  ButtonData->{
    URL["https://docs.mongodb.org/manual/reference/operator/update/set/"], 
    None},
  ButtonNote->
   "https://docs.mongodb.org/manual/reference/operator/update/set/"],
 "."
}], "Subitem"]
}, Open  ]],

Cell[BoxData[{
 RowBox[{
  RowBox[{"query", "=", 
   RowBox[{"<|", 
    RowBox[{"\"\<BoundingBoxLabels\>\"", "\[Rule]", " ", "\"\<Hyena\>\""}], 
    "|>"}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"updateDoc", "=", 
   RowBox[{"<|", 
    RowBox[{"\"\<$set\>\"", "\[Rule]", 
     RowBox[{"<|", 
      RowBox[{"\"\<Dimensions\>\"", "\[Rule]", " ", 
       RowBox[{"{", 
        RowBox[{"2", ",", "2"}], "}"}]}], "|>"}]}], "|>"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{"CollectionUpdate", "[", 
  RowBox[{"$testCollection", ",", "query", ",", " ", "updateDoc"}], 
  "]"}]}], "Input"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"#Dimensions", "&"}], " ", "/@", 
  RowBox[{"ReadList", "@", 
   RowBox[{"CollectionFind", "[", "$testCollection", "]"}]}]}]], "Input"],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{
   RowBox[{"{", 
    RowBox[{"288", ",", "299"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"2", ",", "2"}], "}"}]}], "}"}]], "Output"]
}, Open  ]],

Cell["\<\
If you don\[CloseCurlyQuote]t use the $set operator, the entire document gets \
replaced (except for the primary key)\
\>", "Item"],

Cell[BoxData[{
 RowBox[{
  RowBox[{"updateDoc", "=", 
   RowBox[{"<|", 
    RowBox[{"\"\<NewKey\>\"", "\[Rule]", " ", "1"}], "|>"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{"CollectionUpdate", "[", 
  RowBox[{"$testCollection", ",", "query", ",", " ", "updateDoc"}], 
  "]"}]}], "Input"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"ReadList", "@", 
  RowBox[{"CollectionFind", "[", "$testCollection", "]"}]}]], "Input"],

Cell[BoxData[
 RowBox[{"{", "}"}]], "Output"]
}, Open  ]],

Cell[CellGroupData[{

Cell["\<\
Upsert: normally, if no document matches the query, nothing is done. To \
modify this so that the document is inserted if it doesn\[CloseCurlyQuote]t \
already exist, use Upsert option\
\>", "Item"],

Cell["\<\
This is a useful way of adding new documents to a collection without creating \
duplicates.\
\>", "Subitem"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"CollectionCount", "@", "$testCollection"}]], "Input"],

Cell[BoxData["2"], "Output"]
}, Open  ]],

Cell[BoxData[
 RowBox[{
  RowBox[{"(*", " ", 
   RowBox[{"Nothing", " ", "matches", " ", "this", " ", "query"}], " ", 
   "*)"}], "\[IndentingNewLine]", 
  RowBox[{
   RowBox[{"query", "=", 
    RowBox[{"<|", 
     RowBox[{
     "\"\<BoundingBoxLabels\>\"", "\[Rule]", " ", "\"\<asdfjoisdjf\>\""}], 
     "|>"}]}], ";"}], " "}]], "Input"],

Cell[BoxData[{
 RowBox[{
  RowBox[{"updateDoc", "=", 
   RowBox[{"<|", 
    RowBox[{
     RowBox[{"\"\<SegmentationMasks\>\"", "\[Rule]", " ", 
      RowBox[{"{", 
       RowBox[{"1", ",", "2", ",", "3"}], "}"}]}], ",", 
     RowBox[{"\"\<WordNetID\>\"", "\[Rule]", " ", "\"\<n82837\>\""}]}], 
    "|>"}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{"CollectionUpdate", "[", 
  RowBox[{"$testCollection", ",", "query", ",", " ", "updateDoc", ",", 
   RowBox[{"\"\<Upsert\>\"", "\[Rule]", " ", "True"}]}], 
  "]"}], "\[IndentingNewLine]"}], "Input"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Last", "@", 
  RowBox[{"ReadList", "@", 
   RowBox[{"CollectionFind", "[", "$testCollection", "]"}]}]}]], "Input"],

Cell[BoxData[
 RowBox[{"\[LeftAssociation]", 
  RowBox[{
   RowBox[{"\<\"_id\"\>", "\[Rule]", 
    RowBox[{"MongoObjectID", "[", "\<\"56d5b3da290e2f5f17b9d687\"\>", "]"}]}],
    ",", 
   RowBox[{"\<\"SegmentationMasks\"\>", "\[Rule]", 
    RowBox[{"{", 
     RowBox[{"1", ",", "2", ",", "3"}], "}"}]}], ",", 
   RowBox[{"\<\"WordNetID\"\>", "\[Rule]", "\<\"n82837\"\>"}]}], 
  "\[RightAssociation]"}]], "Output"]
}, Open  ]],

Cell["\<\
You can update multiple documents at a time using the \
\[OpenCurlyDoubleQuote]MultiDocumentUpdate\[CloseCurlyDoubleQuote] option.\
\>", "Item"]
}, Closed]],

Cell[CellGroupData[{

Cell["CollectionRemove", "Subsubsection"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"?", "CollectionRemove"}]], "Input"],

Cell[BoxData[
 StyleBox["\<\"\!\(\*RowBox[{\\\"CollectionRemove\\\", \\\"[\\\", \
RowBox[{RowBox[{\\\"MongoCollection\\\", \\\"[\\\", RowBox[{StyleBox[\\\"\
\[Ellipsis]\\\", \\\"TR\\\"]}], \\\"]\\\"}], \\\",\\\",  StyleBox[\\\"query\\\
\", \\\"TI\\\"]}], \\\"]\\\"}]\)\[VeryThinSpace] removes a single document \
from MongoCollection[\[Ellipsis]] that satisfies the query $query. To remove \
all documents, set the Option \\\"MultiDocumentUpdate\\\" to  \\nTrue.\"\>", 
  "MSG"]], "Print", "PrintUsage",
 CellTags->"Info243665843238-5699381"]
}, Open  ]],

Cell["Remove a single document satisfying some query:", "Item"],

Cell[BoxData[
 RowBox[{"CollectionRemove", "[", 
  RowBox[{"$testCollection", ",", 
   RowBox[{"<|", 
    RowBox[{"\"\<BoundingBoxLabels\>\"", "\[Rule]", " ", "\"\<Hyena\>\""}], 
    "|>"}]}], "]"}]], "Input"],

Cell[CellGroupData[{

Cell["Remove all docs from a collection:", "Item"],

Cell["Very dangerous!!", "Subitem"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[{
 RowBox[{"CollectionCount", "@", "$testCollection"}], "\[IndentingNewLine]", 
 RowBox[{"CollectionRemove", "[", 
  RowBox[{"$testCollection", ",", 
   RowBox[{"<|", "|>"}], ",", 
   RowBox[{"\"\<MultiDocumentUpdate\>\"", "\[Rule]", " ", "True"}]}], 
  "]"}], "\[IndentingNewLine]", 
 RowBox[{"CollectionCount", "@", "$testCollection"}]}], "Input"],

Cell[BoxData["3"], "Output"],

Cell[BoxData["0"], "Output"]
}, Open  ]]
}, Closed]]
}, Open  ]],

Cell["Cleaning up", "Subsection"],

Cell[CellGroupData[{

Cell["Appendix A: Types", "Subsection"],

Cell["\<\
The following are the native MongoDB types. It is strongly preferred to use \
only these types, unless not avoidable (eg Entity types). First, all the JSON \
types:\
\>", "Text",
 CellChangeTimes->{{3.663839731338213*^9, 3.663839796106612*^9}, {
  3.6638402708532467`*^9, 3.66384028419461*^9}}],

Cell["String", "Item",
 CellChangeTimes->{{3.663839761458127*^9, 3.663839782896295*^9}}],

Cell[BoxData[
 RowBox[{"<|", 
  RowBox[{"\"\<key\>\"", "\[Rule]", " ", "\"\<The One Went In\>\""}], 
  "|>"}]], "Input",
 CellChangeTimes->{{3.663839839591378*^9, 3.6638398446660852`*^9}, {
  3.6638399010424747`*^9, 3.6638399073865356`*^9}}],

Cell["Integer", "Item",
 CellChangeTimes->{{3.663839761458127*^9, 3.6638398000569963`*^9}}],

Cell[BoxData[
 RowBox[{"<|", 
  RowBox[{"\"\<key\>\"", "->", "456"}], "|>"}]], "Input",
 CellChangeTimes->{{3.663839837423328*^9, 3.663839838050571*^9}, {
  3.663839910308013*^9, 3.663839915770693*^9}}],

Cell["Real", "Item",
 CellChangeTimes->{{3.663839761458127*^9, 3.6638398035472927`*^9}}],

Cell[BoxData[
 RowBox[{"<|", 
  RowBox[{"\"\<key\>\"", "->", "1.2344"}], "|>"}]], "Input",
 CellChangeTimes->{{3.663839834895488*^9, 3.6638398356666813`*^9}, {
  3.6638399195941*^9, 3.663839928026494*^9}}],

Cell["Null (this is the preferred way to indicate missing data)", "Item",
 CellChangeTimes->{{3.663839761458127*^9, 3.6638398073311653`*^9}, {
  3.663839933378375*^9, 3.663839943210112*^9}}],

Cell[BoxData[
 RowBox[{"<|", 
  RowBox[{"\"\<key\>\"", "\[Rule]", " ", "Null"}], "|>"}]], "Input",
 CellChangeTimes->{{3.6638398286589003`*^9, 3.663839832978544*^9}, {
  3.663839930146323*^9, 3.663839948930649*^9}}],

Cell["Boolean (True + False)", "Item",
 CellChangeTimes->{{3.663839761458127*^9, 3.663839815954563*^9}}],

Cell[BoxData[
 RowBox[{"<|", 
  RowBox[{"\"\<key\>\"", "\[Rule]", " ", "True"}], "|>"}]], "Input",
 CellChangeTimes->{{3.663839823092266*^9, 3.663839826002366*^9}, {
  3.6638399513799877`*^9, 3.663839960612269*^9}}],

Cell["Arrays of the basic types", "Item",
 CellChangeTimes->{{3.663839761458127*^9, 3.663839815954563*^9}, {
  3.66383986223569*^9, 3.663839866466343*^9}}],

Cell[BoxData[
 RowBox[{"<|", 
  RowBox[{"\"\<key\>\"", "\[Rule]", 
   RowBox[{"{", 
    RowBox[{"1.2", ",", "5", ",", "5.6", ",", "True"}], "}"}]}], 
  "|>"}]], "Input",
 CellChangeTimes->{{3.663839870309678*^9, 3.66383989591465*^9}, {
  3.6638399638262987`*^9, 3.663839970522553*^9}}],

Cell["If in doubt, check that its JSONizable!", "Text",
 CellChangeTimes->{{3.663839974450012*^9, 3.663839983762435*^9}}],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Developer`WriteRawJSONString", "@", 
  RowBox[{"<|", 
   RowBox[{"\"\<key\>\"", "\[Rule]", 
    RowBox[{"{", 
     RowBox[{"1.2", ",", "5", ",", "5.6", ",", "True"}], "}"}]}], 
   "|>"}]}]], "Input",
 CellChangeTimes->{{3.663839985292852*^9, 3.663839993790082*^9}}],

Cell[BoxData["\<\"{\\n\\t\\\"key\\\":[\\n\\t\\t1.2,\\n\\t\\t5,\\n\\t\\t5.6,\\\
n\\t\\ttrue\\n\\t]\\n}\"\>"], "Output",
 CellChangeTimes->{3.663839994151041*^9}]
}, Open  ]],

Cell["\<\
In addition to the basic JSON types, there are some special types:\
\>", "Text",
 CellChangeTimes->{{3.663840005923443*^9, 3.663840023922525*^9}}],

Cell["DateObject:", "Item",
 CellChangeTimes->{{3.663839761458127*^9, 3.663839815954563*^9}, {
  3.66383986223569*^9, 3.663839866466343*^9}, {3.663840037627906*^9, 
  3.663840038002324*^9}, {3.663840138682234*^9, 3.663840142242614*^9}, {
  3.663937248725317*^9, 3.66393724872899*^9}}],

Cell[BoxData[
 RowBox[{"<|", 
  RowBox[{"\"\<key\>\"", "\[Rule]", " ", 
   TemplateBox[{RowBox[{"\"Sun 7 Feb 2016 18:50:55\"", 
       StyleBox[
        RowBox[{"\"GMT+\"", "\[InvisibleSpace]", "5.5`"}], FontColor -> 
        GrayLevel[0.5]]}],RowBox[{"DateObject", "[", 
       RowBox[{
         RowBox[{"{", 
           RowBox[{"2016", ",", "2", ",", "7"}], "}"}], ",", 
         RowBox[{"TimeObject", "[", 
           RowBox[{
             RowBox[{"{", 
               RowBox[{"18", ",", "50", ",", "55.315639`"}], "}"}], ",", 
             RowBox[{"TimeZone", "\[Rule]", "5.5`"}]}], "]"}], ",", 
         RowBox[{"TimeZone", "\[Rule]", "5.5`"}]}], "]"}]},
    "DateObject",
    Editable->False]}], "|>"}]], "Input"],

Cell["ObjectID:", "Item",
 CellChangeTimes->{{3.663839761458127*^9, 3.663839815954563*^9}, {
  3.66383986223569*^9, 3.663839866466343*^9}, {3.663840037627906*^9, 
  3.663840038002324*^9}, {3.663840138682234*^9, 3.663840142242614*^9}, {
  3.663937248725317*^9, 3.663937268768491*^9}}],

Cell[BoxData[
 RowBox[{"<|", 
  RowBox[{"\"\<key\>\"", "\[Rule]", " ", 
   RowBox[{"MongoObjectID", "[", "\"\<56b74286d682ee04a52df97f\>\"", "]"}]}], 
  "|>"}]], "Input",
 CellChangeTimes->{{3.663937284390059*^9, 3.663937314113028*^9}}],

Cell[TextData[{
 "MongoDB has a fairly rich and simple query language (see ",
 ButtonBox["here",
  BaseStyle->"Hyperlink",
  ButtonData->{
    URL["https://docs.mongodb.org/manual/tutorial/query-documents/"], None},
  ButtonNote->"https://docs.mongodb.org/manual/tutorial/query-documents/"],
 "). A simple query:"
}], "Text",
 CellChangeTimes->{{3.6639367125697613`*^9, 3.663936730032454*^9}, {
  3.66393677569783*^9, 3.663936854264822*^9}}],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"iter", "=", 
  RowBox[{"CollectionFind", "[", 
   RowBox[{"coll", ",", 
    RowBox[{"<|", 
     RowBox[{"\"\<age\>\"", "\[Rule]", " ", "80"}], "|>"}]}], 
   "]"}]}]], "Input",
 CellChangeTimes->{{3.663936734289283*^9, 3.663936745632872*^9}}],

Cell[BoxData[
 TagBox[GridBox[{
    {
     StyleBox["MongoCursor", "Text",
      StripOnInput->False], "\[SpanFromLeft]"}
   },
   AutoDelete->False,
   FrameStyle->GrayLevel[0.85],
   GridBoxAlignment->{"Columns" -> {{Left}}},
   GridBoxDividers->{"Columns" -> {{True}}, "Rows" -> {{True}}},
   GridBoxItemSize->{"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}},
   GridBoxItemStyle->{"Columns" -> {"Text", "Output"}},
   GridBoxSpacings->{"Columns" -> {{1}}, "Rows" -> {{1}}}],
  "Grid"]], "Output",
 CellChangeTimes->{3.6639367462148523`*^9, 3.6639367948142233`*^9, 
  3.6639368475536003`*^9, 3.663936918858335*^9, 3.663938347499675*^9}]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Dataset", "@", 
  RowBox[{"ReadList", "@", "iter"}]}]], "Input"],

Cell[BoxData[
 TagBox[
  TemplateBox[{GridBox[{{
       StyleBox["\"_id\"", 
        GrayLevel[0.3]], 
       StyleBox["\"class\"", 
        GrayLevel[0.3]], 
       StyleBox["\"age\"", 
        GrayLevel[0.3]], 
       StyleBox["\"sex\"", 
        GrayLevel[0.3]], 
       StyleBox["\"survived\"", 
        GrayLevel[0.3]]}, {
       InterpretationBox[
        TagBox[
         RowBox[{"MongoObjectID", "[", "\"56b88a74d682ee08887278ed\"", "]"}], 
         Short[#, 5]& ], 
        MongoLink`MongoObjectID["56b88a74d682ee08887278ed"]], 
       StyleBox["\"1st\"", FontColor -> GrayLevel[0.4]], 80, 
       StyleBox["\"male\"", FontColor -> GrayLevel[0.4]], 
       InterpretationBox["True", True]}, {
       ItemBox[
        RowBox[{"2 levels", 
          AdjustmentBox[" | ", BoxBaselineShift -> -0.3], 
          RowBox[{"1", "rows"}]}], 
        BaseStyle -> {
         FontFamily -> "Helvetica", FontSize -> 10, FontColor -> 
          GrayLevel[0.4], Editable -> False, Selectable -> False}, 
        ItemSize -> {Automatic, Automatic}, Alignment -> {Left, Center}, 
        Background -> RGBColor[0.92, 0.92, 0.9]], "\[SpanFromLeft]", 
       "\[SpanFromLeft]", "\[SpanFromLeft]", "\[SpanFromLeft]"}}, 
     GridBoxFrame -> {"ColumnsIndexed" -> {{{1, -1}, {1, -1}} -> True}}, 
     FrameStyle -> RGBColor[0, 0, 0, 0.4], GridBoxDividers -> {"Columns" -> {
         RGBColor[0, 0, 0, 0.4], {
          RGBColor[0, 0, 0, 0.09]}, 
         RGBColor[0, 0, 0, 0.4]}, "Rows" -> {
         RGBColor[0, 0, 0, 0.4], 
         RGBColor[0, 0, 0, 0.3], {
          RGBColor[0, 0, 0, 0.08]}, 
         RGBColor[0, 0, 0, 0.4]}}, RowSpacings -> {1.5, 1.2}, 
     GridBoxBackground -> {"Columns" -> {}, "Rows" -> {
         RGBColor[0.92, 0.92, 0.9]}}, 
     GridBoxAlignment -> {"Columns" -> {{Left}}}, ColumnSpacings -> 2.5, 
     GridFrameMargins -> {{2, 3}, {1, 3}}, 
     GridBoxItemSize -> {"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}},
      RowMinHeight -> 1.3],"Dataset[{__Association}]"},
   "Dataset",
   DisplayFunction->(TagBox[
     StyleBox[#, {
      ShowAutoStyles -> False, LineBreakWithin -> False, FontWeight -> 
       "Light", FontFamily -> "Helvetica Neue", NumberMarks -> False, 
       SpanMaxSize -> 3, SpanMinSize -> 1., Editable -> False, Selectable -> 
       True, Background -> RGBColor[0.985, 0.98, 0.973], 
       LinebreakAdjustments -> {0.4, 5, 100, 0, 0.5}, LineIndent -> 0, 
       LineSpacing -> {1.1, 5}}], Deploy]& ),
   InterpretationFunction->(#2& )],
  False,
  Editable->False,
  SelectWithContents->True,
  Selectable->False]], "Output",
 CellChangeTimes->{3.6639367541896152`*^9, 3.663936796098957*^9, 
  3.663936920004117*^9, 3.6639383504667263`*^9}]
}, Open  ]],

Cell["Doing this on the WL side instead:", "Text",
 CellChangeTimes->{{3.66393692232368*^9, 3.663936934936695*^9}}],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"titanicDataset", "[", 
  RowBox[{"Select", "[", 
   RowBox[{
    RowBox[{"#age", " ", "\[Equal]", " ", "80"}], "&"}], "]"}], 
  "]"}]], "Input",
 CellChangeTimes->{{3.663936937841301*^9, 3.663936951080945*^9}}],

Cell[BoxData[
 TagBox[
  TemplateBox[{GridBox[{{
       StyleBox["\"_id\"", 
        GrayLevel[0.3]], 
       StyleBox["\"class\"", 
        GrayLevel[0.3]], 
       StyleBox["\"age\"", 
        GrayLevel[0.3]], 
       StyleBox["\"sex\"", 
        GrayLevel[0.3]], 
       StyleBox["\"survived\"", 
        GrayLevel[0.3]]}, {
       InterpretationBox[
        TagBox[
         RowBox[{"MongoObjectID", "[", "\"56b88a74d682ee08887278ed\"", "]"}], 
         Short[#, 5]& ], 
        MongoLink`MongoObjectID["56b88a74d682ee08887278ed"]], 
       InterpretationBox[
        StyleBox["\"1st\"", 
         GrayLevel[0.45]], "1st"], 
       InterpretationBox[
        TagBox["80", Short[#, 5]& ], 80], 
       InterpretationBox[
        StyleBox["\"male\"", 
         GrayLevel[0.45]], "male"], 
       InterpretationBox["True", True]}, {
       ItemBox[
        RowBox[{"2 levels", 
          AdjustmentBox[" | ", BoxBaselineShift -> -0.3], 
          RowBox[{"1", "rows"}]}], 
        BaseStyle -> {
         FontFamily -> "Helvetica", FontSize -> 10, FontColor -> 
          GrayLevel[0.4], Editable -> False, Selectable -> False}, 
        ItemSize -> {Automatic, Automatic}, Alignment -> {Left, Center}, 
        Background -> RGBColor[0.92, 0.92, 0.9]], "\[SpanFromLeft]", 
       "\[SpanFromLeft]", "\[SpanFromLeft]", "\[SpanFromLeft]"}}, 
     GridBoxFrame -> {"ColumnsIndexed" -> {{{1, -1}, {1, -1}} -> True}}, 
     FrameStyle -> RGBColor[0, 0, 0, 0.4], GridBoxDividers -> {"Columns" -> {
         RGBColor[0, 0, 0, 0.4], {
          RGBColor[0, 0, 0, 0.09]}, 
         RGBColor[0, 0, 0, 0.4]}, "Rows" -> {
         RGBColor[0, 0, 0, 0.4], 
         RGBColor[0, 0, 0, 0.3], {
          RGBColor[0, 0, 0, 0.08]}, 
         RGBColor[0, 0, 0, 0.4]}}, RowSpacings -> {1.5, 1.2}, 
     GridBoxBackground -> {"Columns" -> {}, "Rows" -> {
         RGBColor[0.92, 0.92, 0.9]}}, 
     GridBoxAlignment -> {"Columns" -> {{Left}}}, ColumnSpacings -> 2.5, 
     GridFrameMargins -> {{2, 3}, {1, 3}}, 
     GridBoxItemSize -> {"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}},
      RowMinHeight -> 1.3],"Dataset[{__Association}]"},
   "Dataset",
   DisplayFunction->(TagBox[
     StyleBox[#, {
      ShowAutoStyles -> False, LineBreakWithin -> False, FontWeight -> 
       "Light", FontFamily -> "Helvetica Neue", NumberMarks -> False, 
       SpanMaxSize -> 3, SpanMinSize -> 1., Editable -> False, Selectable -> 
       True, Background -> RGBColor[0.985, 0.98, 0.973], 
       LinebreakAdjustments -> {0.4, 5, 100, 0, 0.5}, LineIndent -> 0, 
       LineSpacing -> {1.1, 5}}], Deploy]& ),
   InterpretationFunction->(#2& )],
  False,
  Editable->False,
  SelectWithContents->True,
  Selectable->False]], "Output",
 CellChangeTimes->{3.6639369513911963`*^9, 3.66393835267936*^9}]
}, Open  ]]
}, Closed]]
}, Open  ]],

Cell[CellGroupData[{

Cell["Work", "Subchapter",
 CellChangeTimes->{{3.663809161330207*^9, 3.663809161656825*^9}, 
   3.663816197927302*^9}],

Cell[CellGroupData[{

Cell["Notes:", "Subsection",
 CellChangeTimes->{{3.663829042930532*^9, 3.663829044129134*^9}}],

Cell["Is this a bug?", "Item",
 CellChangeTimes->{{3.663829059402227*^9, 3.6638290731294317`*^9}, {
  3.663829241418641*^9, 3.663829243457204*^9}}],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"DateObject", "[", 
  RowBox[{"{", 
   RowBox[{"\"\<1970/6000000\>\"", ",", " ", 
    RowBox[{"{", 
     RowBox[{"\"\<Year\>\"", ",", " ", "\"\<Second\>\""}], "}"}]}], "}"}], 
  "]"}]], "Input",
 CellChangeTimes->{{3.663829248147563*^9, 3.6638292605536327`*^9}}],

Cell[BoxData[
 TemplateBox[{RowBox[{"\"Tue 20 Jan 1970 17:37:12\"", 
     StyleBox[
      RowBox[{"\"GMT+\"", "\[InvisibleSpace]", "5.5`"}], FontColor -> 
      GrayLevel[0.5]]}],RowBox[{"DateObject", "[", 
     RowBox[{
       RowBox[{"{", 
         RowBox[{"1970", ",", "1", ",", "20"}], "}"}], ",", 
       RowBox[{"TimeObject", "[", 
         RowBox[{
           RowBox[{"{", 
             RowBox[{"17", ",", "37", ",", "12.704`"}], "}"}], ",", 
           RowBox[{"TimeZone", "\[Rule]", "5.5`"}]}], "]"}], ",", 
       RowBox[{"TimeZone", "\[Rule]", "5.5`"}]}], "]"}]},
  "DateObject",
  Editable->False]], "Output",
 CellChangeTimes->{{3.663829246093108*^9, 3.663829261242909*^9}}]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"DateObject", "[", 
  RowBox[{"{", 
   RowBox[{"\"\<1970/60000000\>\"", ",", " ", 
    RowBox[{"{", 
     RowBox[{"\"\<Year\>\"", ",", " ", "\"\<Second\>\""}], "}"}]}], "}"}], 
  "]"}]], "Input",
 CellChangeTimes->{3.663829269522648*^9}],

Cell[BoxData[
 TemplateBox[{RowBox[{"\"Tue 30 Dec 1969 12:00:57\"", 
     StyleBox[
      RowBox[{"\"GMT+\"", "\[InvisibleSpace]", "5.5`"}], FontColor -> 
      GrayLevel[0.5]]}],RowBox[{"DateObject", "[", 
     RowBox[{
       RowBox[{"{", 
         RowBox[{"1969", ",", "12", ",", "30"}], "}"}], ",", 
       RowBox[{"TimeObject", "[", 
         RowBox[{
           RowBox[{"{", 
             RowBox[{"12", ",", "0", ",", "57.856`"}], "}"}], ",", 
           RowBox[{"TimeZone", "\[Rule]", "5.5`"}]}], "]"}], ",", 
       RowBox[{"TimeZone", "\[Rule]", "5.5`"}]}], "]"}]},
  "DateObject",
  Editable->False]], "Output",
 CellChangeTimes->{3.663829269974794*^9}]
}, Open  ]],

Cell[CellGroupData[{

Cell["\<\
Suggestion: FromUnixTime should support options like \
\[OpenCurlyDoubleQuote]DateFormat\[CloseCurlyDoubleQuote]\
\>", "Item",
 CellChangeTimes->{{3.663829059402227*^9, 3.6638290731294317`*^9}, {
  3.663829241418641*^9, 3.663829243457204*^9}, {3.663829332810946*^9, 
  3.663829335121386*^9}, {3.6638305618824577`*^9, 3.663830575521081*^9}}],

Cell["Suggestion: FromUnixTime and UnixTime are not invertible", "Item",
 CellChangeTimes->{{3.663829059402227*^9, 3.6638290731294317`*^9}, {
  3.663829241418641*^9, 3.663829243457204*^9}, {3.663829332810946*^9, 
  3.663829335121386*^9}, {3.6638305618824577`*^9, 3.663830575521081*^9}, {
  3.663831835634704*^9, 3.663831845217358*^9}}]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[{
 RowBox[{
  RowBox[{"unixTime", "=", "1454840647.456"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{"t", "=", 
  RowBox[{"FromUnixTime", "[", "unixTime", "]"}]}], "\[IndentingNewLine]", 
 RowBox[{"t", "[", "\"\<Millisecond\>\"", "]"}]}], "Input",
 CellChangeTimes->{{3.663831858945118*^9, 3.663831905037175*^9}}],

Cell[BoxData[
 TemplateBox[{RowBox[{"\"Sun 7 Feb 2016 15:54:07\"", 
     StyleBox[
      RowBox[{"\"GMT+\"", "\[InvisibleSpace]", "5.5`"}], FontColor -> 
      GrayLevel[0.5]]}],RowBox[{"DateObject", "[", 
     RowBox[{
       RowBox[{"{", 
         RowBox[{"2016", ",", "2", ",", "7"}], "}"}], ",", 
       RowBox[{"TimeObject", "[", 
         RowBox[{
           RowBox[{"{", 
             RowBox[{"15", ",", "54", ",", "7.456000328063965`"}], "}"}], ",", 
           RowBox[{"TimeZone", "\[Rule]", "5.5`"}]}], "]"}], ",", 
       RowBox[{"TimeZone", "\[Rule]", "5.5`"}]}], "]"}]},
  "DateObject",
  Editable->False]], "Output",
 CellChangeTimes->{{3.663831860166779*^9, 3.6638319053229523`*^9}}],

Cell[BoxData["456"], "Output",
 CellChangeTimes->{{3.663831860166779*^9, 3.663831905333949*^9}}]
}, Open  ]],

Cell["Now getting the unix time doesn\[CloseCurlyQuote]t return the original \
time:", "Text",
 CellChangeTimes->{{3.663831934288844*^9, 3.663831946617344*^9}}],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"UnixTime", "@", "t"}]], "Input",
 CellChangeTimes->{{3.663831887907148*^9, 3.663831889437958*^9}, 
   3.663831924978744*^9}],

Cell[BoxData["1454840647"], "Output",
 CellChangeTimes->{3.663831925309613*^9}]
}, Open  ]],

Cell["querying milliseconds is slow compared to getting seconds:", "Item",
 CellChangeTimes->{{3.663829059402227*^9, 3.6638290731294317`*^9}, {
  3.663829241418641*^9, 3.663829243457204*^9}, {3.663829332810946*^9, 
  3.663829335121386*^9}, {3.6638305618824577`*^9, 3.663830575521081*^9}, {
  3.663831835634704*^9, 3.663831845217358*^9}, {3.66383214581057*^9, 
  3.6638321547853603`*^9}, {3.6638322051065693`*^9, 3.663832220720934*^9}, {
  3.6638324017949142`*^9, 3.663832404577422*^9}}],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"t", "=", 
  RowBox[{"DateObject", "[", "]"}]}]], "Input",
 CellChangeTimes->{{3.663832157241197*^9, 3.663832160404269*^9}}],

Cell[BoxData[
 TemplateBox[{RowBox[{"\"Sun 7 Feb 2016 16:39:20\"", 
     StyleBox[
      RowBox[{"\"GMT+\"", "\[InvisibleSpace]", "5.5`"}], FontColor -> 
      GrayLevel[0.5]]}],RowBox[{"DateObject", "[", 
     RowBox[{
       RowBox[{"{", 
         RowBox[{"2016", ",", "2", ",", "7"}], "}"}], ",", 
       RowBox[{"TimeObject", "[", 
         RowBox[{
           RowBox[{"{", 
             RowBox[{"16", ",", "39", ",", "20.665965`"}], "}"}], ",", 
           RowBox[{"TimeZone", "\[Rule]", "5.5`"}]}], "]"}], ",", 
       RowBox[{"TimeZone", "\[Rule]", "5.5`"}]}], "]"}]},
  "DateObject",
  Editable->False]], "Output",
 CellChangeTimes->{3.6638321606775703`*^9}]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"RepeatedTiming", "@", 
  RowBox[{"t", "[", "\"\<Millisecond\>\"", "]"}]}]], "Input",
 CellChangeTimes->{{3.663832162372533*^9, 3.663832172585844*^9}}],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{"0.00005614772727272726685369616528298309`2.", ",", "665"}], 
  "}"}]], "Output",
 CellChangeTimes->{{3.663832173317574*^9, 3.663832178137122*^9}, 
   3.663832407538102*^9}]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"RepeatedTiming", "@", 
  RowBox[{"FractionalPart", "@", 
   RowBox[{"t", "[", "\"\<Second\>\"", "]"}]}]}]], "Input",
 CellChangeTimes->{{3.663832184107071*^9, 3.6638321847136803`*^9}, {
  3.663832239177834*^9, 3.6638322431697073`*^9}}],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{
  "3.87353515624999955081503993925551`2.*^-6", ",", "0.6659649999999999`"}], 
  "}"}]], "Output",
 CellChangeTimes->{3.663832184967112*^9, 3.6638322436344547`*^9, 
  3.6638324088098707`*^9}]
}, Open  ]],

Cell["Weird replace all behaviour with associations", "Item",
 CellChangeTimes->{{3.663832766258429*^9, 3.663832779745585*^9}}],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"t", "=", 
  RowBox[{"ReplaceAll", "[", 
   RowBox[{
    RowBox[{"<|", 
     RowBox[{"\"\<key\>\"", "\[Rule]", " ", 
      RowBox[{"{", 
       RowBox[{"\"\<$symbol\>\"", "\[Rule]", " ", "\"\<Sin\>\""}], "}"}]}], 
     "|>"}], ",", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"Rule", "[", 
       RowBox[{"\"\<$symbol\>\"", ",", "x_"}], "]"}], "}"}], ":>", " ", 
     RowBox[{"ToExpression", "@", "x"}]}]}], "]"}]}]], "Input",
 CellChangeTimes->{{3.663832814859661*^9, 3.6638328171615467`*^9}}],

Cell[BoxData[
 RowBox[{"\[LeftAssociation]", 
  RowBox[{"\<\"key\"\>", "\[Rule]", 
   RowBox[{"ToExpression", "[", "\<\"Sin\"\>", "]"}]}], 
  "\[RightAssociation]"}]], "Output",
 CellChangeTimes->{3.663832781394109*^9, 3.663832817663377*^9, 
  3.663832947167163*^9}]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"t", "=", 
  RowBox[{"ReplaceAll", "[", 
   RowBox[{
    RowBox[{"{", 
     RowBox[{"\"\<key\>\"", "\[Rule]", " ", 
      RowBox[{"{", 
       RowBox[{"\"\<$symbol\>\"", "\[Rule]", " ", "\"\<Sin\>\""}], "}"}]}], 
     "}"}], ",", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"Rule", "[", 
       RowBox[{"\"\<$symbol\>\"", ",", "x_"}], "]"}], "}"}], ":>", " ", 
     RowBox[{"ToExpression", "@", "x"}]}]}], "]"}]}]], "Input",
 CellChangeTimes->{{3.663832787923024*^9, 3.6638328213870277`*^9}}],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{"\<\"key\"\>", "\[Rule]", "Sin"}], "}"}]], "Output",
 CellChangeTimes->{{3.663832799591658*^9, 3.663832821714014*^9}}]
}, Open  ]],

Cell[BoxData[""], "Input",
 CellChangeTimes->{{3.663832252702272*^9, 3.6638322580254183`*^9}}]
}, Open  ]]
}, Closed]]
}, Open  ]]
},
InitializationCellEvaluation->False,
WindowSize->{1615, 998},
WindowMargins->{{359, Automatic}, {Automatic, 277}},
Magnification:>2. Inherited,
FrontEndVersion->"10.4 for Linux x86 (64-bit) (February 15, 2016)",
StyleDefinitions->"Default.nb"
]
(* End of Notebook Content *)

(* Internal cache information *)
(*CellTagsOutline
CellTagsIndex->{
 "Info243665843238-5699381"->{
  Cell[72951, 1827, 542, 8, 296, "Print",
   CellTags->"Info243665843238-5699381"]},
 "Info983665842172-2073150"->{
  Cell[67421, 1644, 1090, 15, 362, "Print",
   CellTags->"Info983665842172-2073150"]}
 }
*)
(*CellTagsIndex
CellTagsIndex->{
 {"Info243665843238-5699381", 95813, 2481},
 {"Info983665842172-2073150", 95929, 2484}
 }
*)
(*NotebookFileOutline
Notebook[{
Cell[CellGroupData[{
Cell[580, 22, 104, 1, 186, "Title"],
Cell[687, 25, 114, 3, 60, "Item"],
Cell[804, 30, 272, 7, 176, "Code"],
Cell[1079, 39, 250, 7, 99, "Item"],
Cell[CellGroupData[{
Cell[1354, 50, 434, 12, 176, "Code"],
Cell[1791, 64, 109, 2, 60, "Output"]
}, Open  ]],
Cell[1915, 69, 30, 0, 61, "Input"],
Cell[CellGroupData[{
Cell[1970, 73, 171, 2, 128, "Subchapter"],
Cell[CellGroupData[{
Cell[2166, 79, 42, 0, 88, "Subsection"],
Cell[2211, 81, 47, 0, 60, "Item"],
Cell[CellGroupData[{
Cell[2283, 85, 103, 2, 61, "Input"],
Cell[2389, 89, 251, 5, 99, "Output"]
}, Open  ]],
Cell[2655, 97, 129, 3, 60, "Item"],
Cell[CellGroupData[{
Cell[2809, 104, 369, 8, 140, "Input"],
Cell[3181, 114, 195, 5, 43, "Message"],
Cell[3379, 121, 34, 0, 60, "Output"],
Cell[3416, 123, 69, 1, 60, "Output"]
}, Open  ]]
}, Open  ]],
Cell[CellGroupData[{
Cell[3534, 130, 41, 0, 88, "Subsection"],
Cell[3578, 132, 34, 0, 116, "Item"],
Cell[CellGroupData[{
Cell[3637, 136, 1781, 42, 510, "Input"],
Cell[5421, 180, 26511, 571, 140, "Output"]
}, Open  ]],
Cell[CellGroupData[{
Cell[31969, 756, 28, 0, 116, "Item"],
Cell[32000, 758, 377, 7, 226, "Subitem"]
}, Open  ]],
Cell[CellGroupData[{
Cell[32414, 770, 109, 2, 112, "Input"],
Cell[32526, 774, 444, 9, 140, "Output"]
}, Open  ]]
}, Closed]],
Cell[CellGroupData[{
Cell[33019, 789, 50, 0, 68, "Subsection"],
Cell[CellGroupData[{
Cell[33094, 793, 33, 0, 136, "Subsubsection"],
Cell[33130, 795, 51, 0, 116, "Item"],
Cell[CellGroupData[{
Cell[33206, 799, 77, 1, 112, "Input"],
Cell[33286, 802, 28, 0, 156, "Output"]
}, Open  ]],
Cell[CellGroupData[{
Cell[33351, 807, 105, 3, 116, "Item"],
Cell[33459, 812, 316, 7, 98, "Subitem"]
}, Open  ]],
Cell[CellGroupData[{
Cell[33812, 824, 208, 5, 112, "Input"],
Cell[34023, 831, 28, 0, 156, "Output"]
}, Open  ]]
}, Open  ]],
Cell[CellGroupData[{
Cell[34100, 837, 32, 0, 136, "Subsubsection"],
Cell[34135, 839, 86, 2, 116, "Item"],
Cell[CellGroupData[{
Cell[34246, 845, 107, 2, 112, "Input"],
Cell[34356, 849, 1327, 38, 316, "Output"]
}, Open  ]],
Cell[35698, 890, 32, 0, 116, "Item"],
Cell[CellGroupData[{
Cell[35755, 894, 55, 1, 112, "Input"],
Cell[35813, 897, 933, 23, 356, "Output"]
}, Open  ]],
Cell[CellGroupData[{
Cell[36783, 925, 55, 1, 112, "Input"],
Cell[36841, 928, 789, 19, 356, "Output"]
}, Open  ]],
Cell[37645, 950, 52, 0, 116, "Item"],
Cell[CellGroupData[{
Cell[37722, 954, 55, 1, 112, "Input"],
Cell[37780, 957, 44, 0, 156, "Output"]
}, Open  ]],
Cell[CellGroupData[{
Cell[37861, 962, 100, 2, 116, "Item"],
Cell[37964, 966, 110, 3, 98, "Subitem"]
}, Open  ]],
Cell[CellGroupData[{
Cell[38111, 974, 397, 10, 180, "Input"],
Cell[38511, 986, 26757, 578, 480, "Output"]
}, Open  ]]
}, Open  ]],
Cell[CellGroupData[{
Cell[65317, 1570, 38, 0, 136, "Subsubsection"],
Cell[65358, 1572, 293, 5, 248, "Item"],
Cell[CellGroupData[{
Cell[65676, 1581, 195, 4, 112, "Input"],
Cell[65874, 1587, 964, 22, 334, "Output"]
}, Open  ]]
}, Open  ]]
}, Closed]],
Cell[CellGroupData[{
Cell[66899, 1616, 41, 0, 68, "Subsection"],
Cell[CellGroupData[{
Cell[66965, 1620, 41, 0, 70, "Subsubsection"],
Cell[CellGroupData[{
Cell[67031, 1624, 113, 3, 116, "Item"],
Cell[CellGroupData[{
Cell[67169, 1631, 96, 2, 98, "Subitem"],
Cell[67268, 1635, 42, 0, 98, "Subitem"]
}, Open  ]]
}, Open  ]],
Cell[CellGroupData[{
Cell[67359, 1641, 59, 1, 112, "Input"],
Cell[67421, 1644, 1090, 15, 362, "Print",
 CellTags->"Info983665842172-2073150"]
}, Open  ]],
Cell[CellGroupData[{
Cell[68548, 1664, 123, 3, 116, "Item"],
Cell[68674, 1669, 330, 10, 98, "Subitem"]
}, Open  ]],
Cell[69019, 1682, 600, 17, 246, "Input"],
Cell[CellGroupData[{
Cell[69644, 1703, 169, 4, 112, "Input"],
Cell[69816, 1709, 175, 6, 156, "Output"]
}, Open  ]],
Cell[70006, 1718, 141, 3, 116, "Item"],
Cell[70150, 1723, 292, 8, 180, "Input"],
Cell[CellGroupData[{
Cell[70467, 1735, 111, 2, 112, "Input"],
Cell[70581, 1739, 45, 1, 156, "Output"]
}, Open  ]],
Cell[CellGroupData[{
Cell[70663, 1745, 208, 4, 180, "Item"],
Cell[70874, 1751, 118, 3, 98, "Subitem"]
}, Open  ]],
Cell[CellGroupData[{
Cell[71029, 1759, 77, 1, 112, "Input"],
Cell[71109, 1762, 28, 0, 156, "Output"]
}, Open  ]],
Cell[71152, 1765, 338, 10, 180, "Input"],
Cell[71493, 1777, 546, 13, 246, "Input"],
Cell[CellGroupData[{
Cell[72064, 1794, 138, 3, 112, "Input"],
Cell[72205, 1799, 412, 10, 156, "Output"]
}, Open  ]],
Cell[72632, 1812, 154, 3, 116, "Item"]
}, Closed]],
Cell[CellGroupData[{
Cell[72823, 1820, 41, 0, 54, "Subsubsection"],
Cell[CellGroupData[{
Cell[72889, 1824, 59, 1, 112, "Input"],
Cell[72951, 1827, 542, 8, 296, "Print",
 CellTags->"Info243665843238-5699381"]
}, Open  ]],
Cell[73508, 1838, 63, 0, 116, "Item"],
Cell[73574, 1840, 209, 5, 112, "Input"],
Cell[CellGroupData[{
Cell[73808, 1849, 50, 0, 116, "Item"],
Cell[73861, 1851, 35, 0, 98, "Subitem"]
}, Open  ]],
Cell[CellGroupData[{
Cell[73933, 1856, 362, 7, 246, "Input"],
Cell[74298, 1865, 28, 0, 156, "Output"],
Cell[74329, 1867, 28, 0, 156, "Output"]
}, Open  ]]
}, Closed]]
}, Open  ]],
Cell[74396, 1872, 33, 0, 88, "Subsection"],
Cell[CellGroupData[{
Cell[74454, 1876, 39, 0, 68, "Subsection"],
Cell[74496, 1878, 304, 6, 196, "Text"],
Cell[74803, 1886, 88, 1, 116, "Item"],
Cell[74894, 1889, 241, 5, 112, "Input"],
Cell[75138, 1896, 91, 1, 116, "Item"],
Cell[75232, 1899, 202, 4, 112, "Input"],
Cell[75437, 1905, 88, 1, 116, "Item"],
Cell[75528, 1908, 205, 4, 112, "Input"],
Cell[75736, 1914, 190, 2, 116, "Item"],
Cell[75929, 1918, 215, 4, 112, "Input"],
Cell[76147, 1924, 104, 1, 116, "Item"],
Cell[76254, 1927, 215, 4, 112, "Input"],
Cell[76472, 1933, 155, 2, 116, "Item"],
Cell[76630, 1937, 285, 7, 112, "Input"],
Cell[76918, 1946, 121, 1, 120, "Text"],
Cell[CellGroupData[{
Cell[77064, 1951, 289, 7, 112, "Input"],
Cell[77356, 1960, 160, 2, 576, "Output"]
}, Open  ]],
Cell[77531, 1965, 156, 3, 120, "Text"],
Cell[77690, 1970, 284, 4, 116, "Item"],
Cell[77977, 1976, 719, 17, 170, "Input"],
Cell[78699, 1995, 283, 4, 116, "Item"],
Cell[78985, 2001, 236, 5, 112, "Input"],
Cell[79224, 2008, 441, 10, 120, "Text"],
Cell[CellGroupData[{
Cell[79690, 2022, 265, 7, 112, "Input"],
Cell[79958, 2031, 646, 15, 172, "Output"]
}, Open  ]],
Cell[CellGroupData[{
Cell[80641, 2051, 88, 2, 112, "Input"],
Cell[80732, 2055, 2695, 61, 352, "Output"]
}, Open  ]],
Cell[83442, 2119, 115, 1, 120, "Text"],
Cell[CellGroupData[{
Cell[83582, 2124, 234, 6, 112, "Input"],
Cell[83819, 2132, 2777, 66, 352, "Output"]
}, Open  ]]
}, Closed]]
}, Open  ]],
Cell[CellGroupData[{
Cell[86657, 2205, 118, 2, 128, "Subchapter"],
Cell[CellGroupData[{
Cell[86800, 2211, 94, 1, 174, "Subsection"],
Cell[86897, 2214, 147, 2, 116, "Item"],
Cell[CellGroupData[{
Cell[87069, 2220, 285, 7, 112, "Input"],
Cell[87357, 2229, 687, 16, 158, "Output"]
}, Open  ]],
Cell[CellGroupData[{
Cell[88081, 2250, 260, 7, 112, "Input"],
Cell[88344, 2259, 663, 16, 158, "Output"]
}, Open  ]],
Cell[CellGroupData[{
Cell[89044, 2280, 350, 6, 116, "Item"],
Cell[89397, 2288, 335, 4, 116, "Item"]
}, Open  ]],
Cell[CellGroupData[{
Cell[89769, 2297, 324, 6, 246, "Input"],
Cell[90096, 2305, 698, 16, 158, "Output"],
Cell[90797, 2323, 96, 1, 112, "Output"]
}, Open  ]],
Cell[90908, 2327, 160, 2, 120, "Text"],
Cell[CellGroupData[{
Cell[91093, 2333, 148, 3, 112, "Input"],
Cell[91244, 2338, 79, 1, 112, "Output"]
}, Open  ]],
Cell[91338, 2342, 486, 6, 116, "Item"],
Cell[CellGroupData[{
Cell[91849, 2352, 147, 3, 112, "Input"],
Cell[91999, 2357, 666, 16, 158, "Output"]
}, Open  ]],
Cell[CellGroupData[{
Cell[92702, 2378, 174, 3, 112, "Input"],
Cell[92879, 2383, 212, 5, 112, "Output"]
}, Open  ]],
Cell[CellGroupData[{
Cell[93128, 2393, 259, 5, 112, "Input"],
Cell[93390, 2400, 230, 6, 132, "Output"]
}, Open  ]],
Cell[93635, 2409, 127, 1, 116, "Item"],
Cell[CellGroupData[{
Cell[93787, 2414, 520, 14, 180, "Input"],
Cell[94310, 2430, 266, 6, 112, "Output"]
}, Open  ]],
Cell[CellGroupData[{
Cell[94613, 2441, 518, 14, 112, "Input"],
Cell[95134, 2457, 157, 3, 112, "Output"]
}, Open  ]],
Cell[95306, 2463, 94, 1, 112, "Input"]
}, Open  ]]
}, Closed]]
}, Open  ]]
}
]
*)

